diff --git a/.gitattributes b/.gitattributes index 724cd4bb3beab5c6b1733d51ead178fe6213e3dc..434ccd1ce9a47ec1549ffb1b7824e8eadf926d44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1565,3 +1565,90 @@ lwhyz--workspace.93d4038/tests/executable filter=lfs diff=lfs merge=lfs -text lyraproj--lyra.dfef42a/environment/executable filter=lfs diff=lfs merge=lfs -text lyraproj--lyra.dfef42a/tests/executable filter=lfs diff=lfs merge=lfs -text lzanini--mdbook-katex.1f63ab8/environment/executable filter=lfs diff=lfs merge=lfs -text +lzanini--mdbook-katex.1f63ab8/tests/executable filter=lfs diff=lfs merge=lfs -text +lzhang10--maxent.3560c94/environment/executable filter=lfs diff=lfs merge=lfs -text +lzhang10--maxent.3560c94/tests/executable filter=lfs diff=lfs merge=lfs -text +m-manu--go-find-duplicates.cd928/environment/executable filter=lfs diff=lfs merge=lfs -text +m-manu--go-find-duplicates.cd928/tests/executable filter=lfs diff=lfs merge=lfs -text +m-ou-se--inline-python.635617f/environment/executable filter=lfs diff=lfs merge=lfs -text +m-ou-se--inline-python.635617f/tests/executable filter=lfs diff=lfs merge=lfs -text +m1guelpf--auto-commit.66e0c86/environment/executable filter=lfs diff=lfs merge=lfs -text +m1guelpf--auto-commit.66e0c86/tests/executable filter=lfs diff=lfs merge=lfs -text +m4444--tmatrix.dd2b3d7/environment/executable filter=lfs diff=lfs merge=lfs -text +m4444--tmatrix.dd2b3d7/tests/executable filter=lfs diff=lfs merge=lfs -text +maaslalani--draw.1220ebb/environment/executable filter=lfs diff=lfs merge=lfs -text +maaslalani--draw.1220ebb/tests/executable filter=lfs diff=lfs merge=lfs -text +maaslalani--typer.0e674b2/environment/executable filter=lfs diff=lfs merge=lfs -text +maaslalani--typer.0e674b2/tests/executable filter=lfs diff=lfs merge=lfs -text +maciejczyzewski--libchaos.4412a8/environment/executable filter=lfs diff=lfs merge=lfs -text +maciejczyzewski--libchaos.4412a8/tests/executable filter=lfs diff=lfs merge=lfs -text +mackerelio--go-osstat.ca86009/environment/executable filter=lfs diff=lfs merge=lfs -text +mackerelio--go-osstat.ca86009/tests/executable filter=lfs diff=lfs merge=lfs -text +magefile--mage.0953947/environment/executable filter=lfs diff=lfs merge=lfs -text +magefile--mage.0953947/tests/executable filter=lfs diff=lfs merge=lfs -text +magic-akari--ncmc.4faead9/environment/executable filter=lfs diff=lfs merge=lfs -text +magic-akari--ncmc.4faead9/tests/executable filter=lfs diff=lfs merge=lfs -text +magnet--metered-rs.f0d878e/environment/executable filter=lfs diff=lfs merge=lfs -text +magnet--metered-rs.f0d878e/tests/executable filter=lfs diff=lfs merge=lfs -text +mahulchak--quickmerge.29c9272/environment/executable filter=lfs diff=lfs merge=lfs -text +mahulchak--quickmerge.29c9272/tests/executable filter=lfs diff=lfs merge=lfs -text +mailtutan--mailtutan.661a6be/environment/executable filter=lfs diff=lfs merge=lfs -text +mailtutan--mailtutan.661a6be/tests/executable filter=lfs diff=lfs merge=lfs -text +mainmatter--cargo-autoinherit.0b/environment/executable filter=lfs diff=lfs merge=lfs -text +mainmatter--cargo-autoinherit.0b/tests/executable filter=lfs diff=lfs merge=lfs -text +manhofer--line3dpp.fbbeca8/environment/executable filter=lfs diff=lfs merge=lfs -text +manhofer--line3dpp.fbbeca8/tests/executable filter=lfs diff=lfs merge=lfs -text +maniartech--signals.695e6ad/environment/executable filter=lfs diff=lfs merge=lfs -text +maniartech--signals.695e6ad/tests/executable filter=lfs diff=lfs merge=lfs -text +manic-systems--dix.bb78117/environment/executable filter=lfs diff=lfs merge=lfs -text +manic-systems--dix.bb78117/tests/executable filter=lfs diff=lfs merge=lfs -text +manishearth--elsa.91944aa/environment/executable filter=lfs diff=lfs merge=lfs -text +manishearth--elsa.91944aa/tests/executable filter=lfs diff=lfs merge=lfs -text +mapbox--protozero.203aa15/environment/executable filter=lfs diff=lfs merge=lfs -text +mapbox--protozero.203aa15/tests/executable filter=lfs diff=lfs merge=lfs -text +marbl--mashmap.1a07d0e/environment/executable filter=lfs diff=lfs merge=lfs -text +marbl--mashmap.1a07d0e/tests/executable filter=lfs diff=lfs merge=lfs -text +marco-calautti--deltapatcher.498/environment/executable filter=lfs diff=lfs merge=lfs -text +marco-calautti--deltapatcher.498/tests/executable filter=lfs diff=lfs merge=lfs -text +marco-lancini--goscan.17b0823/environment/executable filter=lfs diff=lfs merge=lfs -text +marco-lancini--goscan.17b0823/tests/executable filter=lfs diff=lfs merge=lfs -text +marcusbuffett--pipe-rename.be217/environment/executable filter=lfs diff=lfs merge=lfs -text +marcusbuffett--pipe-rename.be217/tests/executable filter=lfs diff=lfs merge=lfs -text +marianogappa--chart.3be5b2b/environment/executable filter=lfs diff=lfs merge=lfs -text +marianogappa--chart.3be5b2b/tests/executable filter=lfs diff=lfs merge=lfs -text +mario-eth--soldeer.e4aac28/environment/executable filter=lfs diff=lfs merge=lfs -text +mario-eth--soldeer.e4aac28/tests/executable filter=lfs diff=lfs merge=lfs -text +markbates--grift.416fdcd/environment/executable filter=lfs diff=lfs merge=lfs -text +markbates--grift.416fdcd/tests/executable filter=lfs diff=lfs merge=lfs -text +martinmoene--lest.60b1993/environment/executable filter=lfs diff=lfs merge=lfs -text +martinmoene--lest.60b1993/tests/executable filter=lfs diff=lfs merge=lfs -text +martinobdl--itch.2c3ab03/environment/executable filter=lfs diff=lfs merge=lfs -text +martinobdl--itch.2c3ab03/tests/executable filter=lfs diff=lfs merge=lfs -text +martinraison--ascii-tv.c0514a3/environment/executable filter=lfs diff=lfs merge=lfs -text +martinraison--ascii-tv.c0514a3/tests/executable filter=lfs diff=lfs merge=lfs -text +martinsos--edlib.0ddc23e/environment/executable filter=lfs diff=lfs merge=lfs -text +martinsos--edlib.0ddc23e/tests/executable filter=lfs diff=lfs merge=lfs -text +masterminds--structable.a1a302e/environment/executable filter=lfs diff=lfs merge=lfs -text +masterminds--structable.a1a302e/tests/executable filter=lfs diff=lfs merge=lfs -text +math-fehr--fast-wfc.0edfccf/environment/executable filter=lfs diff=lfs merge=lfs -text +math-fehr--fast-wfc.0edfccf/tests/executable filter=lfs diff=lfs merge=lfs -text +matm--gocov-html.84704c2/environment/executable filter=lfs diff=lfs merge=lfs -text +matm--gocov-html.84704c2/tests/executable filter=lfs diff=lfs merge=lfs -text +matsuyoshi30--germanium.e120b36/environment/executable filter=lfs diff=lfs merge=lfs -text +matsuyoshi30--germanium.e120b36/tests/executable filter=lfs diff=lfs merge=lfs -text +matsuyoshi30--gitsu.72f9b67/environment/executable filter=lfs diff=lfs merge=lfs -text +matsuyoshi30--gitsu.72f9b67/tests/executable filter=lfs diff=lfs merge=lfs -text +mattes--go-asciibot.3fa6d76/environment/executable filter=lfs diff=lfs merge=lfs -text +mattes--go-asciibot.3fa6d76/tests/executable filter=lfs diff=lfs merge=lfs -text +mattgathu--duma.6e06e9a/environment/executable filter=lfs diff=lfs merge=lfs -text +mattgathu--duma.6e06e9a/tests/executable filter=lfs diff=lfs merge=lfs -text +mattiasflodin--reckless.1f0d847/environment/executable filter=lfs diff=lfs merge=lfs -text +mattiasflodin--reckless.1f0d847/tests/executable filter=lfs diff=lfs merge=lfs -text +mattolenik--hclq.5b31af0/environment/executable filter=lfs diff=lfs merge=lfs -text +mattolenik--hclq.5b31af0/tests/executable filter=lfs diff=lfs merge=lfs -text +mavam--libbf.4c9efc1/environment/executable filter=lfs diff=lfs merge=lfs -text +mavam--libbf.4c9efc1/tests/executable filter=lfs diff=lfs merge=lfs -text +max-rocket-internet--k8s-event-l/environment/executable filter=lfs diff=lfs merge=lfs -text +max-rocket-internet--k8s-event-l/tests/executable filter=lfs diff=lfs merge=lfs -text +maxmind--geoip2-csv-converter.ee/environment/executable filter=lfs diff=lfs merge=lfs -text +maxmind--geoip2-csv-converter.ee/tests/executable filter=lfs diff=lfs merge=lfs -text diff --git a/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_01.tar.gz b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..96f08dae9dea3ad1aec6658d7ef297e78508548d --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d85ed5d591d49fedc269b87eb1415b609c7a74359f02f1fee0471e7f0e002e6e +size 12228 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_02.tar.gz b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ee0d49aea93d11028b99fe110dc0bbb5796590eb --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb87074980b2c1df212b7053f699efef185cfbeb5fc9c6df76daaf14ac25168b +size 18147 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_03.tar.gz b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2a8cc88e25c1ef84826aaaf09ec17e415279ccbe --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7b9c917ab2ef9a5ca391ed1a2672fbec02195da9fc197728d3df5e8d3629eef +size 19095 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_04.tar.gz b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0c431f1e69f89069f424518780835a3cf51a18b5 --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:691e62c48f73020a06582f74a2ce70f684fef3e3833d9f791a7c0e4d864ce63f +size 28646 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/download.sh b/lzanini--mdbook-katex.1f63ab8/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a977c2aabf8efd2f5a0a4019a96934ba255b3434 --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/download.sh @@ -0,0 +1,918 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym NETWORKED download stage for mdbook-katex (Rust/Cargo). +# Sourced (source /source_ro/download.sh), never executed as a script, so it must +# be source-safe: it keeps exported env vars in the current shell and returns +# instead of exiting. It ONLY prefetches Cargo dependencies; it never compiles, +# links, tests, or builds. +# +# Rust build-skill rules applied: +# * No probing of cargo/rustc/rustup (no version checks). +# * Does NOT read any repository file (no Cargo.toml / Cargo.lock reads at runtime; +# both are embedded inline below). +# * cargo fetch runs with --manifest-path against a temporary generated manifest, +# never from /source_ro or the repository root. +# * The repository Cargo.toml and Cargo.lock are embedded verbatim so that +# `cargo fetch --locked` reproduces the EXACT locked dependency closure the +# offline build (which honors the committed Cargo.lock) needs. A fresh un-locked +# resolution would pick newer versions and the offline build would fail. + +set -e + +_dl_err() { + echo "download.sh: error: $*" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# --------------------------------------------------------------------------- +# 1. Recreate the repository manifest + lockfile in a temporary directory. +# download.sh must not touch the (read-only) repository tree, so everything +# lives under a fresh mktemp dir. +# --------------------------------------------------------------------------- +DL_DIR=$(mktemp -d "${TMPDIR:-/tmp}/mdbook-katex-download.XXXXXX") || _dl_err "mktemp failed" +mkdir -p "$DL_DIR/src" + +cat > "$DL_DIR/Cargo.toml" <<'MBK_CARGO_TOML' +[package] +name = "mdbook-katex" +version = "0.10.0-alpha" +authors = [ + "Lucas Zanini ", + "Steven Hé (Sīchàng) ", +] +edition = "2021" +description = "mdBook preprocessor rendering LaTeX equations to HTML." +license = "MIT" +readme = "README.md" +repository = "https://github.com/lzanini/mdbook-katex" + +[dependencies] +clap = { version = "4.5.53", features = ["cargo"] } +mdbook-preprocessor = {version = "0.5.3"} +serde = "1.0.228" +serde_derive = "1.0" +serde_json = "1.0.145" +toml = "0.9.8" +tracing = { version = "0.1.41", default-features = false, features = [ + "attributes", +] } +tracing-subscriber = { version = "0.3.20", default-features = false, features = [ + "ansi", + "env-filter", + "fmt", +] } +rayon = "1.11" +katex = { version = "0.4.6", default-features = false, optional = true } + +[features] +default = ["quick-js"] +pre-render = ["dep:katex"] +quick-js = ["pre-render", "katex/quick-js"] +duktape = ["pre-render", "katex/duktape"] + +[profile.release] +opt-level = "z" +lto = true +MBK_CARGO_TOML + +cat > "$DL_DIR/Cargo.lock" <<'MBK_CARGO_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "cc" +version = "1.2.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "copy_dir" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "543d1dd138ef086e2ff05e3a48cf9da045da2033d16f8538fd76b86cd49b2ca3" +dependencies = [ + "walkdir", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "ducc" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41bc1f8a30712eb6a7454f85747f218d9dfb41d173bb223a8c4f18daff829207" +dependencies = [ + "cesu8", + "ducc-sys", +] + +[[package]] +name = "ducc-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cdea834bf6a0fde522374db4404695c5f0465fc0ee814f2878d76eaabd4ffed" +dependencies = [ + "cc", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "katex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bdbc7a1823f188f56ac9486993536b70a2686a58d47095dcc10507a7d242bf5" +dependencies = [ + "cfg-if", + "derive_builder", + "ducc", + "itertools", + "quick-js", + "thiserror", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libquickjs-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f0b24e9bd171b75ae0295bd428fb8fe58410fb23156e5f34a4657a70c3cee96" +dependencies = [ + "cc", + "copy_dir", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "mdbook-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fc1c4da7fd9e2e412f3891428f9468fab890ed159723ed0892bb85a049ac1c1" +dependencies = [ + "anyhow", + "regex", + "serde", + "serde_json", + "toml 1.1.2+spec-1.1.0", + "tracing", +] + +[[package]] +name = "mdbook-katex" +version = "0.10.0-alpha" +dependencies = [ + "clap", + "katex", + "mdbook-preprocessor", + "rayon", + "serde", + "serde_derive", + "serde_json", + "toml 0.9.8", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mdbook-preprocessor" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eff7b4afaafd664a649a03b8891ad8199aef359a35b911ad6c31acab38ed209" +dependencies = [ + "anyhow", + "mdbook-core", + "serde", + "serde_json", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-js" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19cb4cefcb00f4ab9b332664d06005a74f582ac16aa959c6ad5912957bd83e5f" +dependencies = [ + "libquickjs-sys", + "once_cell", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "toml" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime 0.7.3", + "toml_parser", + "toml_writer", + "winnow 0.7.14", +] + +[[package]] +name = "toml" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.3", +] + +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.3", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "thread_local", + "tracing", + "tracing-core", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" + +[[package]] +name = "winnow" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +MBK_CARGO_LOCK + +# --------------------------------------------------------------------------- +# 2. Minimal stub sources so the generated package manifest validates during +# `cargo fetch` (the real repository sources are not available here, and +# download.sh is forbidden from reading them anyway). fetch only resolves +# dependencies; it never compiles these stubs. +# --------------------------------------------------------------------------- +printf 'fn main() {} +' > "$DL_DIR/src/main.rs" +printf ' +' > "$DL_DIR/src/lib.rs" + +# --------------------------------------------------------------------------- +# 3. Prefetch the exact locked dependency closure. This downloads and stores all +# crates.io .crate sources into CARGO_HOME, which the OFFline build stage then +# uses. build.sh will run `cargo build --offline` against the repository's own +# committed Cargo.lock, so the fetched versions must match -- hence --locked. +# --------------------------------------------------------------------------- +cargo fetch --locked --manifest-path "$DL_DIR/Cargo.toml" + +# The offline build runs from the repository root and writes into ./target; keep +# the default CARGO_TARGET_DIR (target) so build.sh can find the binary there. +export CARGO_TARGET_DIR=target diff --git a/lzanini--mdbook-katex.1f63ab8/tests/executable b/lzanini--mdbook-katex.1f63ab8/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..18092021522c339f337d7b6d3e21132f902399f9 --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b05c9480664f213600fc57b09ce853359c6c455a6818bde5c12d4fb60447b753 +size 3575576 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/harbor_prepare_download_env.sh b/lzanini--mdbook-katex.1f63ab8/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/lzanini--mdbook-katex.1f63ab8/tests/programgym_evaluator.py b/lzanini--mdbook-katex.1f63ab8/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/lzanini--mdbook-katex.1f63ab8/tests/programgym_task.json b/lzanini--mdbook-katex.1f63ab8/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..cf8e39aed7e5d84d485d3771ae7b3ea6709d377e --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/programgym_task.json @@ -0,0 +1,2819 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli.TestHelpSubcommand.test_help_supports_declares_renderer", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli.TestDispatchSelection.test_no_subcommand_enters_preprocess_arm", + "eval.tests.test_cli.TestDispatchSelection.test_supports_subcommand_enters_supports_arm", + "eval.tests.test_cli.TestHelpSubcommand.test_help_shortcut_supports", + "eval.tests.test_cli.TestHelpSubcommand.test_help_subcommand_lists_top_level", + "eval.tests.test_cli.TestHelpSubcommand.test_help_supports_declares_renderer", + "eval.tests.test_cli.TestHelpSubcommand.test_help_supports_subcommand", + "eval.tests.test_cli.TestHelpSubcommand.test_help_unknown_subcommand_fails[foo]", + "eval.tests.test_cli.TestHelpSubcommand.test_help_unknown_subcommand_fails[nope]", + "eval.tests.test_cli.TestHelpSubcommand.test_help_unknown_subcommand_fails[render]", + "eval.tests.test_cli.TestHelpSubcommand.test_help_unknown_subcommand_fails[unknown]", + "eval.tests.test_cli.TestHelpSubcommand.test_help_unknown_subcommand_fails[xyz]", + "eval.tests.test_cli.TestMalformedArgs.test_bare_positional_is_unrecognized_subcommand[book]", + "eval.tests.test_cli.TestMalformedArgs.test_bare_positional_is_unrecognized_subcommand[chapter]", + "eval.tests.test_cli.TestMalformedArgs.test_bare_positional_is_unrecognized_subcommand[html]", + "eval.tests.test_cli.TestMalformedArgs.test_bare_positional_is_unrecognized_subcommand[render]", + "eval.tests.test_cli.TestMalformedArgs.test_bare_positional_is_unrecognized_subcommand[serve]", + "eval.tests.test_cli.TestMalformedArgs.test_help_supports_extra_tail_rejected", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_long_flag_matches_exact", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_short_flag_fails[-n]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_short_flag_fails[-q]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_short_flag_fails[-w]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_short_flag_fails[-x]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_short_flag_fails[-z]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[build]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[clean]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[init]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[render]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[serve]", + "eval.tests.test_cli.TestMalformedArgs.test_unknown_subcommand_name_fails[watch]", + "eval.tests.test_cli.TestTopHelp.test_help_advertises_supports", + "eval.tests.test_cli.TestTopHelp.test_help_begins_with_about_line", + "eval.tests.test_cli.TestTopHelp.test_help_flags_match_exact[--help]", + "eval.tests.test_cli.TestTopHelp.test_help_flags_match_exact[-h]", + "eval.tests.test_cli.TestTopHelp.test_help_long_equals_short", + "eval.tests.test_cli.TestVersion.test_version_flags_match_exact[--version]", + "eval.tests.test_cli.TestVersion.test_version_flags_match_exact[-V]", + "eval.tests.test_cli.TestVersion.test_version_ignores_trailing_positional", + "eval.tests.test_cli.TestVersion.test_version_real_output_is_semver", + "eval.tests.test_cli.TestVersion.test_version_short_equals_long", + "eval.tests.test_preprocess_dispatch.TestBookEcho.test_empty_book_succeeds", + "eval.tests.test_preprocess_dispatch.TestBookEcho.test_exit_zero_valid_book", + "eval.tests.test_preprocess_dispatch.TestBookEcho.test_output_is_well_formed_json", + "eval.tests.test_preprocess_dispatch.TestBookEcho.test_plain_content_echoes_verbatim_with_no_css", + "eval.tests.test_preprocess_dispatch.TestBookEcho.test_stylesheet_prefix_added_by_default", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_chapter_metadata_preserved", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_draft_chapter_content_untouched", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_multiple_chapters_preserved", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_nested_sub_items_processed", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_part_title_preserved", + "eval.tests.test_preprocess_dispatch.TestBookStructurePreserved.test_separator_preserved", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config0]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config1]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config2]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config3]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config4]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config5]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_config_shapes_succeed[config6]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[custom]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[epub]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[html]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[latex]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[linkcheck]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[pdf]", + "eval.tests.test_preprocess_dispatch.TestConfigDispatch.test_renderer_field_accepted[print]", + "eval.tests.test_preprocess_dispatch.TestCustomDelimitersDispatch.test_custom_block_delimiter_renders_display", + "eval.tests.test_preprocess_dispatch.TestCustomDelimitersDispatch.test_custom_delim_disables_plain_dollar", + "eval.tests.test_preprocess_dispatch.TestCustomDelimitersDispatch.test_custom_inline_delimiter", + "eval.tests.test_preprocess_dispatch.TestCustomDelimitersDispatch.test_include_src_adds_katex_src_wrapper", + "eval.tests.test_preprocess_dispatch.TestCustomDelimitersDispatch.test_no_include_src_no_wrapper", + "eval.tests.test_preprocess_dispatch.TestEscapeModeDispatch.test_escape_mode_injects_css_header", + "eval.tests.test_preprocess_dispatch.TestEscapeModeDispatch.test_escape_mode_keeps_math_literal", + "eval.tests.test_preprocess_dispatch.TestEscapeModeDispatch.test_escape_mode_no_rendered_span", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_common_functions_render[$\\\\alpha$-\\u03b1]", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_common_functions_render[$\\\\frac{a}{b}$-]", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_common_functions_render[$\\\\sqrt{x}$-]", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_common_functions_render[$x^2$-]", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_display_math_exact", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_inline_and_display_distinct", + "eval.tests.test_preprocess_dispatch.TestMathRenderDispatch.test_inline_math_exact", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_empty_stdin", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_json_object_not_tuple", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_non_json_stdin", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[\"just-a-string\"-invalid type: string \"just-a-string\", expected a tuple of size 2 at line 1 column 15]", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[42-invalid type: integer `42`, expected a tuple of size 2 at line 1 column 2]", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[[]-invalid length 0, expected a tuple of size 2 at line 1 column 2]", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[null-invalid type: null, expected a tuple of size 2 at line 1 column 4]", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[true-invalid type: boolean `true`, expected a tuple of size 2 at line 1 column 4]", + "eval.tests.test_preprocess_dispatch.TestStdinParseErrors.test_wrong_tuple_shapes_rejected[{\"root\":\"/x\"}-invalid type: map, expected a tuple of size 2 at line 1 column 1]", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_matching_version_no_warning", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_does_not_affect_stdout", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_emits_warning[0.0.0]", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_emits_warning[0.3.0]", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_emits_warning[0.4.37]", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_emits_warning[0.5.1]", + "eval.tests.test_preprocess_dispatch.TestVersionWarningDispatch.test_mismatch_emits_warning[9.9.9]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[1]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[BARBaz]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[a_b-c.d]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[bar-baz]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[custom-renderer-2026]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[foo]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[html5]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[not-supported]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[renderer:with:colons]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[sitemap]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[underscore_renderer]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_arbitrary_renderer_exit_zero[x-uuid-9f8e7d6c]", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_empty_string_renderer_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_option_terminator_then_value_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_renderer_with_embedded_newline_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_renderer_with_emoji_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_renderer_with_leading_trailing_spaces", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_renderer_with_space_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_renderer_with_unicode_exit_zero", + "eval.tests.test_supports.TestSupportsArbitraryNames.test_very_long_renderer_exit_zero", + "eval.tests.test_supports.TestSupportsErrors.test_supports_double_dash_then_more_flags_value", + "eval.tests.test_supports.TestSupportsErrors.test_supports_help_flag_matches_exact", + "eval.tests.test_supports.TestSupportsErrors.test_supports_missing_renderer_exact", + "eval.tests.test_supports.TestSupportsErrors.test_supports_terminator_with_no_value_fails", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_long_flag_exact[--all]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_long_flag_exact[--bogus]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_long_flag_exact[--verbose]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_long_flag_exact[--version]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_short_flag_exact[-V]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_short_flag_exact[-i]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_short_flag_exact[-o]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_short_flag_exact[-q]", + "eval.tests.test_supports.TestSupportsErrors.test_supports_unknown_short_flag_exact[-x]", + "eval.tests.test_supports.TestSupportsOutputClean.test_supports_exact_empty_output_bytes", + "eval.tests.test_supports.TestSupportsOutputClean.test_supports_stderr_empty_for_custom_renderer", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[epub]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[html]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[latex]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[linkcheck]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[markdown]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[pdf]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[print]", + "eval.tests.test_supports.TestSupportsSupportedRenderers.test_renderer_supported_exit_zero_clean[void]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_backtick_excessive.test_custom_delimiter_after_excessive_span", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_dollar_inside_excessive_span_is_code_not_math", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_escaped_dollar_after_excessive_span_untouched", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_excessive_run_stops_display_math_unescaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_excessive_run_stops_following_math_unescaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_excessive_span_does_not_leak_into_following_math", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_excessive_while_loop_skips_all_extra_backticks", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_math_before_excessive_span_still_escaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_backtick_excessive.test_normal_spans_in_sequence_then_math", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_backtick_excessive.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_draft_chapter_not_processed", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_empty_stdin_errors", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_help_exits_zero", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_invalid_json_input_errors", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_missing_structure_input_errors", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_multiple_chapters_each_escaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_nested_subchapter_escaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_supports_arbitrary_renderer", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_supports_extra_help", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_supports_known_renderer_html", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_supports_known_renderer_markdown", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_supports_missing_renderer_errors", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_and_robustness.test_valid_json_exits_zero_and_json_out", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_and_robustness.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_escaping.test_custom_inline_delim_left_more_specific_than_right", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_delimiter_escaping.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_escaping.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_backtick_span_with_run_of_backticks", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_custom_inline_delimiter_first_byte", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_display_preferred_over_inline", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_inline_block_edge_delimiter_overlap", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_math_before_and_after_code_span", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_mixed_inline_and_display_blocks", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_delimiter_scanning.test_repeated_dollar_inline", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_delimiter_scanning.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_escape_characters.test_escape_empty_math", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_escape_characters.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_escape_characters.test_escape_repeated_special_padding", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_escape_characters.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_escape_characters.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_escape_characters.test_escape_spaces_preserved", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_escape_characters.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_adjacent_inline_blocks_no_separator", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_display_block_preserves_outer_text", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_escaped_right_delimiter_keeps_block_open", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_even_backslash_run_closes_block", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_inline_immediately_follows_text_no_spaces", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_odd_backslash_run_keeps_block_open", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_math_block_preservation.test_unclosed_display_after_inline", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_math_block_preservation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_backtick_span_with_dollar_inside_then_math", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_delimiter_body_and_token_special_composition", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_dollar_star_custom_delimiter_star_escaped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_empty_block_delimiter_panics", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_empty_inline_delimiter_panics", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_even_two_backslash_run_in_body_then_close", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_long_odd_run_then_real_closer", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_multiline_display_block_then_more_math", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scan_byte_dispatch_edges.test_special_sequence_with_escaped_dollar_body", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_scan_byte_dispatch_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_backtick_excessive.test_custom_delimiter_after_excessive_span", + "eval.tests.test_backtick_excessive.test_dollar_inside_excessive_span_is_code_not_math", + "eval.tests.test_backtick_excessive.test_escaped_dollar_after_excessive_span_untouched", + "eval.tests.test_backtick_excessive.test_excessive_run_stops_display_math_unescaped", + "eval.tests.test_backtick_excessive.test_excessive_run_stops_following_math_unescaped", + "eval.tests.test_backtick_excessive.test_excessive_run_then_real_closer_resumes_scan[```x```` ``` then $m_n$-```x```` ``` then $m\\\\_n$]", + "eval.tests.test_backtick_excessive.test_excessive_run_then_real_closer_resumes_scan[```x````` ``` then $c_d$-```x````` ``` then $c\\\\_d$]", + "eval.tests.test_backtick_excessive.test_excessive_run_then_real_closer_resumes_scan[``x`````` y`` then $a_b$-``x`````` y`` then $a\\\\_b$]", + "eval.tests.test_backtick_excessive.test_excessive_run_then_real_closer_resumes_scan[a ``code``` more`` tail $t_1$-a ``code``` more`` tail $t\\\\_1$]", + "eval.tests.test_backtick_excessive.test_excessive_run_without_closer_leaves_trailing_raw[``x```` tail]", + "eval.tests.test_backtick_excessive.test_excessive_run_without_closer_leaves_trailing_raw[``x`````]", + "eval.tests.test_backtick_excessive.test_excessive_run_without_closer_leaves_trailing_raw[pre ``x```` tail $i_j$ and $$k_l$$]", + "eval.tests.test_backtick_excessive.test_excessive_span_does_not_leak_into_following_math", + "eval.tests.test_backtick_excessive.test_excessive_while_loop_skips_all_extra_backticks", + "eval.tests.test_backtick_excessive.test_math_before_excessive_span_still_escaped", + "eval.tests.test_backtick_excessive.test_normal_spans_in_sequence_then_math", + "eval.tests.test_cli_and_robustness.test_draft_chapter_not_processed", + "eval.tests.test_cli_and_robustness.test_empty_stdin_errors", + "eval.tests.test_cli_and_robustness.test_headers_prefixed_to_each_non_draft_chapter", + "eval.tests.test_cli_and_robustness.test_help_exits_zero", + "eval.tests.test_cli_and_robustness.test_help_lists_supports_subcommand", + "eval.tests.test_cli_and_robustness.test_invalid_json_input_errors", + "eval.tests.test_cli_and_robustness.test_missing_structure_input_errors", + "eval.tests.test_cli_and_robustness.test_multiple_chapters_each_escaped", + "eval.tests.test_cli_and_robustness.test_nested_subchapter_escaped", + "eval.tests.test_cli_and_robustness.test_supports_arbitrary_renderer", + "eval.tests.test_cli_and_robustness.test_supports_extra_help", + "eval.tests.test_cli_and_robustness.test_supports_known_renderer_html", + "eval.tests.test_cli_and_robustness.test_supports_known_renderer_markdown", + "eval.tests.test_cli_and_robustness.test_supports_missing_renderer_errors", + "eval.tests.test_cli_and_robustness.test_untouched_separator_and_part_items", + "eval.tests.test_cli_and_robustness.test_valid_json_exits_zero_and_json_out", + "eval.tests.test_cli_and_robustness.test_version_flag", + "eval.tests.test_css_header.test_header_appears_once", + "eval.tests.test_css_header.test_header_prepended_default", + "eval.tests.test_css_header.test_header_prepended_empty_chapter", + "eval.tests.test_css_header.test_header_prepended_without_math", + "eval.tests.test_css_header.test_header_then_body_order", + "eval.tests.test_css_header.test_no_css_does_not_change_escaping[extra0]", + "eval.tests.test_css_header.test_no_css_does_not_change_escaping[extra1]", + "eval.tests.test_css_header.test_no_css_false_keeps_header", + "eval.tests.test_css_header.test_no_css_true_suppresses_header", + "eval.tests.test_delimiter_escaping.test_begin_end_block_delimiter_escaped", + "eval.tests.test_delimiter_escaping.test_block_paren_delimiter_escaped", + "eval.tests.test_delimiter_escaping.test_custom_delimiter_that_is_a_substring_of_other_text", + "eval.tests.test_delimiter_escaping.test_custom_inline_delim_left_more_specific_than_right", + "eval.tests.test_delimiter_escaping.test_custom_inline_delimiter_multichar_no_escape", + "eval.tests.test_delimiter_escaping.test_delimiter_stars_escaped", + "eval.tests.test_delimiter_escaping.test_delimiter_triangle_and_caret_passthrough", + "eval.tests.test_delimiter_escaping.test_delimiter_underscores_escaped", + "eval.tests.test_delimiter_escaping.test_inline_paren_delimiter_escaped", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[(]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[)]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[<]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[=]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[>]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[@]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[[]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[]]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[^]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[{]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[|]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[}]", + "eval.tests.test_delimiter_escaping.test_plain_custom_inline_delimiter_single_char[~]", + "eval.tests.test_delimiter_scanning.test_backtick_code_skips_math[`$a*$` then $b$-`$a*$` then $b$]", + "eval.tests.test_delimiter_scanning.test_backtick_code_skips_math[```\\n$z_1$\\n```-```\\n$z_1$\\n```]", + "eval.tests.test_delimiter_scanning.test_backtick_code_skips_math[code `x_1 and $y*$` end-code `x_1 and $y*$` end]", + "eval.tests.test_delimiter_scanning.test_backtick_span_with_run_of_backticks", + "eval.tests.test_delimiter_scanning.test_custom_delimiters[delims0-a \\\\[x_1*y\\\\] b-a \\\\\\\\[x\\\\_1\\\\*y\\\\\\\\] b]", + "eval.tests.test_delimiter_scanning.test_custom_delimiters[delims1-a \\\\[x*y\\\\] b-a \\\\\\\\[x\\\\*y\\\\\\\\] b]", + "eval.tests.test_delimiter_scanning.test_custom_delimiters[delims2-a MATHx_yEND b-a MATHx\\\\_yEND b]", + "eval.tests.test_delimiter_scanning.test_custom_delimiters[delims3-a BEGx*yFIN b-a BEGx\\\\*yFIN b]", + "eval.tests.test_delimiter_scanning.test_custom_inline_delimiter_first_byte", + "eval.tests.test_delimiter_scanning.test_delimiter_not_closed_keeps_text", + "eval.tests.test_delimiter_scanning.test_display_delimiter_not_closed_keeps_text", + "eval.tests.test_delimiter_scanning.test_display_formula_positions[$$x$$ post-$$x$$ post]", + "eval.tests.test_delimiter_scanning.test_display_formula_positions[$$x$$-$$x$$]", + "eval.tests.test_delimiter_scanning.test_display_formula_positions[a $$x$$ b-a $$x$$ b]", + "eval.tests.test_delimiter_scanning.test_display_formula_positions[pre $$x$$-pre $$x$$]", + "eval.tests.test_delimiter_scanning.test_display_preferred_over_inline", + "eval.tests.test_delimiter_scanning.test_escaped_delimiter_inside_math[a $x\\\\$\\\\$y$ b-a $x\\\\\\\\$\\\\\\\\$y$ b]", + "eval.tests.test_delimiter_scanning.test_escaped_delimiter_inside_math[a $x\\\\$y$ b-a $x\\\\\\\\$y$ b]", + "eval.tests.test_delimiter_scanning.test_escaped_display_delimiter_is_literal", + "eval.tests.test_delimiter_scanning.test_escaped_inline_delimiter_is_literal", + "eval.tests.test_delimiter_scanning.test_inline_block_edge_delimiter_overlap", + "eval.tests.test_delimiter_scanning.test_inline_formula_positions[$x$ tail-$x$ tail]", + "eval.tests.test_delimiter_scanning.test_inline_formula_positions[$x$-$x$]", + "eval.tests.test_delimiter_scanning.test_inline_formula_positions[a $x$ b-a $x$ b]", + "eval.tests.test_delimiter_scanning.test_inline_formula_positions[head $x$-head $x$]", + "eval.tests.test_delimiter_scanning.test_math_before_and_after_code_span", + "eval.tests.test_delimiter_scanning.test_mixed_inline_and_display_blocks", + "eval.tests.test_delimiter_scanning.test_multiple_blocks_sequence", + "eval.tests.test_delimiter_scanning.test_repeated_dollar_inline", + "eval.tests.test_escape_characters.test_escape_backslash_characters[$\\\\pi$-$\\\\\\\\pi$]", + "eval.tests.test_escape_characters.test_escape_backslash_characters[$a\\\\\\\\\\\\b$-$a\\\\\\\\\\\\\\\\\\\\\\\\b$]", + "eval.tests.test_escape_characters.test_escape_backslash_characters[$a\\\\\\\\b$-$a\\\\\\\\\\\\\\\\b$]", + "eval.tests.test_escape_characters.test_escape_empty_math", + "eval.tests.test_escape_characters.test_escape_mixed_special_characters[$\\\\frac{a}{b}_x*y$-$\\\\\\\\frac{a}{b}\\\\_x\\\\*y$]", + "eval.tests.test_escape_characters.test_escape_mixed_special_characters[$\\\\sum_{n=1}$-$\\\\\\\\sum\\\\_{n=1}$]", + "eval.tests.test_escape_characters.test_escape_mixed_special_characters[$a*b \\\\\\\\ c$-$a\\\\*b \\\\\\\\\\\\\\\\ c$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$ab12$-$ab12$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x & y$-$x & y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x#y$-$x#y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x%y$-$x%y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x+y$-$x+y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x-y$-$x-y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x/y$-$x/y$]", + "eval.tests.test_escape_characters.test_escape_passthrough_characters[$x/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/lzanini--mdbook-katex.1f63ab8/tests/workspace.tar.gz b/lzanini--mdbook-katex.1f63ab8/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b015370962c059dcbfb4de240a5be8704742676e --- /dev/null +++ b/lzanini--mdbook-katex.1f63ab8/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33591a5e9c4de1a39829ce6904ca615d4838397c51984fa1306cddbc54c181d6 +size 4184 diff --git a/lzhang10--maxent.3560c94/environment/Dockerfile b/lzhang10--maxent.3560c94/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bcfa04437d24f8eb8652a133e82f9c25c0c57a0 --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/lzhang10--maxent.3560c94/environment/docker-compose.yaml b/lzhang10--maxent.3560c94/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/lzhang10--maxent.3560c94/environment/download.sh b/lzhang10--maxent.3560c94/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..d77113fc5278cb9e1b3028e5bd06db06d0ecfa68 --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/download.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym networked dependency-prep stage for maxent. +# +# This script is sourced (not executed) during the download validation step: +# source /source_ro/download.sh +# It is a standalone file and must not read any repository source file. It only +# installs explicit system packages that build.sh needs (compilers, CMake, +# Boost, zlib, fortran) and exports the environment that build.sh relies on. It +# does not compile, link, test, package, or install built artifacts. + +# Fail on real errors. In source mode we cannot call exit, so return nonzero +# via an explicit branch. +set -u + +fail() { + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +if [ "$(id -u)" -ne 0 ]; then + echo "download.sh: must run as root to install system packages" >&2 + fail +fi + +# Refresh the apt package index. This is required for apt-get install to work. +# stdout and stderr are kept in separate log files so stderr remains visible +# and is not merged into stdout. +APT_UPDATE_OUT=/tmp/maxent_apt_update.out +APT_UPDATE_ERR=/tmp/maxent_apt_update.err +if ! apt-get update > "$APT_UPDATE_OUT" 2> "$APT_UPDATE_ERR"; then + echo "download.sh: apt-get update failed" >&2 + echo "--- stdout ---" >&2 + cat "$APT_UPDATE_OUT" >&2 + echo "--- stderr ---" >&2 + cat "$APT_UPDATE_ERR" >&2 + fail +fi + +# Install the build dependencies required by the maxent C++ binary. These are +# exactly the packages INSTALL.md lists for Debian/Ubuntu: +# - build-essential : g++, make, and other C/C++ build tooling +# - gfortran : Fortran compiler required to build the +# lbfgs .f optimizer +# - libboost-timer-dev + libboost-chrono-dev : Boost.timer / Boost.chrono used +# by the maxent binary (pulls in libboost-system-dev transitively) +# - zlib1g-dev : zlib headers needed for modelfile I/O +# - cmake : the top-level CMakeLists requires >= 3.5 +# - ninja-build : allowed by the top-level build (optional; +# make is used if ninja is not present) +# stdout and stderr for each install are kept in separate log files. +APT_INSTALL_OUT=/tmp/maxent_apt_install.out +APT_INSTALL_ERR=/tmp/maxent_apt_install.err +DEPS="build-essential gfortran libboost-timer-dev libboost-chrono-dev zlib1g-dev cmake" + +export DEBIAN_FRONTEND=noninteractive +for pkg in $DEPS; do + if ! apt-get install -y --no-install-recommends "$pkg" > "$APT_INSTALL_OUT" 2> "$APT_INSTALL_ERR"; then + echo "download.sh: apt-get install -y $pkg failed" >&2 + echo "--- stdout ---" >&2 + tail -n 40 "$APT_INSTALL_OUT" >&2 + echo "--- stderr ---" >&2 + tail -n 40 "$APT_INSTALL_ERR" >&2 + fail + fi +done + +# Export the build toolchain paths so build.sh can rely on them offline. +export CC="${CC:-gcc}" +export CXX="${CXX:-g++}" +export FC="${FC:-gfortran}" + +echo "download.sh: dependencies installed and environment prepared" diff --git a/lzhang10--maxent.3560c94/environment/executable b/lzhang10--maxent.3560c94/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..73704cbd78109cda51c6a6b260548f7381f5f6e7 --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f7b79ab1dc65b415a6001074f1e1b1acec6e925b63a0a914e70c4d98a44f3fb +size 2803872 diff --git a/lzhang10--maxent.3560c94/environment/harbor_configure_apt_mirror.sh b/lzhang10--maxent.3560c94/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/lzhang10--maxent.3560c94/environment/harbor_prepare_download_env.sh b/lzhang10--maxent.3560c94/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/lzhang10--maxent.3560c94/environment/workspace.tar.gz b/lzhang10--maxent.3560c94/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..37e7d6c37178389cd6fa4ee0ad650b65a437f711 --- /dev/null +++ b/lzhang10--maxent.3560c94/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e01822deeef4d90604500eff673b12570b4410db1009c7c5b9b19e06a26a5f6 +size 32288 diff --git a/lzhang10--maxent.3560c94/instruction.md b/lzhang10--maxent.3560c94/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/lzhang10--maxent.3560c94/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/lzhang10--maxent.3560c94/solution/solve.sh b/lzhang10--maxent.3560c94/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/lzhang10--maxent.3560c94/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/lzhang10--maxent.3560c94/task.toml b/lzhang10--maxent.3560c94/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ad81e542e4e1d84a49a24b349c6bf066d135cff4 --- /dev/null +++ b/lzhang10--maxent.3560c94/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/lzhang10--maxent.3560c94" +description = "Synthetic ProgramGym cleanroom reconstruction task for lzhang10/maxent" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "lzhang10__maxent.3560c94" +repository = "lzhang10/maxent" +commit = "3560c94b737d4272ed86de529e50d823200e6d8e" +language = "cpp" +difficulty = "medium" +difficulty_score = 2.59492266271699 +test_branches = 6 +test_count = 179 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/lzhang10--maxent.3560c94/tests/Dockerfile b/lzhang10--maxent.3560c94/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef45becedb352d71e0d28eefebe80e3c73de2bd3 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/Dockerfile @@ -0,0 +1,72 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_01.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..aea7add531e7369208092fa53a73590998c2c950 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a586193ef79644da7b0099b8b4b7b14995a4e0d2aab11442b2bcf6d67ae0f4ac +size 14966 diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_02.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8543c6d40af7f4b7df2ab0042b1ab441cc4445e0 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f7e339d2d674d87d4a7da0cf93f9bea701773141131aaaaca74166693c2599b +size 16325 diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_03.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6f39d6d8bcabb4acc91b86001bb4a1662e23c9bb --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:409be1f63947e31b3cd252685721d68fe87007f89b2e45e0e49d247d1979329e +size 11113 diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_05.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_05.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..284c4a7acfd3d5ecde517de4b10cb98f45affef9 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_05.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f96a3b16527b9757c386bbcf76c97adfcbbf45acea730bd67c2dd27ed2e39c8e +size 8937 diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_06.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_06.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..350d577b862d676f1607249d31e1cfe01ec07728 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_module_06.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:241fdb11361e98556217a06f1eaf71c69c4b362dc88501527f758a22e25154ba +size 8059 diff --git a/lzhang10--maxent.3560c94/tests/blobs/tests/generated_upstream.tar.gz b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a32c3036cdef80d9000f4389c2c339f9e4b3e84b --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:135bf1260671a5aad788bc3e9d70a6fd297fbd777e0055c1a8dce2cc0d96d250 +size 8309 diff --git a/lzhang10--maxent.3560c94/tests/docker-compose.yaml b/lzhang10--maxent.3560c94/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/lzhang10--maxent.3560c94/tests/download.sh b/lzhang10--maxent.3560c94/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..d77113fc5278cb9e1b3028e5bd06db06d0ecfa68 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/download.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym networked dependency-prep stage for maxent. +# +# This script is sourced (not executed) during the download validation step: +# source /source_ro/download.sh +# It is a standalone file and must not read any repository source file. It only +# installs explicit system packages that build.sh needs (compilers, CMake, +# Boost, zlib, fortran) and exports the environment that build.sh relies on. It +# does not compile, link, test, package, or install built artifacts. + +# Fail on real errors. In source mode we cannot call exit, so return nonzero +# via an explicit branch. +set -u + +fail() { + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +if [ "$(id -u)" -ne 0 ]; then + echo "download.sh: must run as root to install system packages" >&2 + fail +fi + +# Refresh the apt package index. This is required for apt-get install to work. +# stdout and stderr are kept in separate log files so stderr remains visible +# and is not merged into stdout. +APT_UPDATE_OUT=/tmp/maxent_apt_update.out +APT_UPDATE_ERR=/tmp/maxent_apt_update.err +if ! apt-get update > "$APT_UPDATE_OUT" 2> "$APT_UPDATE_ERR"; then + echo "download.sh: apt-get update failed" >&2 + echo "--- stdout ---" >&2 + cat "$APT_UPDATE_OUT" >&2 + echo "--- stderr ---" >&2 + cat "$APT_UPDATE_ERR" >&2 + fail +fi + +# Install the build dependencies required by the maxent C++ binary. These are +# exactly the packages INSTALL.md lists for Debian/Ubuntu: +# - build-essential : g++, make, and other C/C++ build tooling +# - gfortran : Fortran compiler required to build the +# lbfgs .f optimizer +# - libboost-timer-dev + libboost-chrono-dev : Boost.timer / Boost.chrono used +# by the maxent binary (pulls in libboost-system-dev transitively) +# - zlib1g-dev : zlib headers needed for modelfile I/O +# - cmake : the top-level CMakeLists requires >= 3.5 +# - ninja-build : allowed by the top-level build (optional; +# make is used if ninja is not present) +# stdout and stderr for each install are kept in separate log files. +APT_INSTALL_OUT=/tmp/maxent_apt_install.out +APT_INSTALL_ERR=/tmp/maxent_apt_install.err +DEPS="build-essential gfortran libboost-timer-dev libboost-chrono-dev zlib1g-dev cmake" + +export DEBIAN_FRONTEND=noninteractive +for pkg in $DEPS; do + if ! apt-get install -y --no-install-recommends "$pkg" > "$APT_INSTALL_OUT" 2> "$APT_INSTALL_ERR"; then + echo "download.sh: apt-get install -y $pkg failed" >&2 + echo "--- stdout ---" >&2 + tail -n 40 "$APT_INSTALL_OUT" >&2 + echo "--- stderr ---" >&2 + tail -n 40 "$APT_INSTALL_ERR" >&2 + fail + fi +done + +# Export the build toolchain paths so build.sh can rely on them offline. +export CC="${CC:-gcc}" +export CXX="${CXX:-g++}" +export FC="${FC:-gfortran}" + +echo "download.sh: dependencies installed and environment prepared" diff --git a/lzhang10--maxent.3560c94/tests/executable b/lzhang10--maxent.3560c94/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..73704cbd78109cda51c6a6b260548f7381f5f6e7 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f7b79ab1dc65b415a6001074f1e1b1acec6e925b63a0a914e70c4d98a44f3fb +size 2803872 diff --git a/lzhang10--maxent.3560c94/tests/harbor_configure_apt_mirror.sh b/lzhang10--maxent.3560c94/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/lzhang10--maxent.3560c94/tests/harbor_prepare_download_env.sh b/lzhang10--maxent.3560c94/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/lzhang10--maxent.3560c94/tests/programgym_evaluator.py b/lzhang10--maxent.3560c94/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/lzhang10--maxent.3560c94/tests/programgym_task.json b/lzhang10--maxent.3560c94/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..e0c4a4b3392a752f574a9a437fd61002d2598172 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/programgym_task.json @@ -0,0 +1,317 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_args_parsing.test_duplicate_model_option_rejected", + "eval.tests.test_args_parsing.test_duplicate_verbose_option_rejected", + "eval.tests.test_args_parsing.test_estimate_group_conflict_lbfgs_and_gis", + "eval.tests.test_args_parsing.test_help_long_flag_exact_output", + "eval.tests.test_args_parsing.test_help_short_flag_exact_output", + "eval.tests.test_args_parsing.test_iter_accepts_integer_value", + "eval.tests.test_args_parsing.test_mode_group_conflict_predict_and_cv", + "eval.tests.test_args_parsing.test_no_inputs_prints_help_and_fails", + "eval.tests.test_args_parsing.test_short_option_predict_flag_toggles_mode", + "eval.tests.test_args_parsing.test_unknown_long_option", + "eval.tests.test_args_parsing.test_unknown_short_option", + "eval.tests.test_args_parsing.test_version_long_flag", + "eval.tests.test_args_parsing.test_version_short_flag", + "eval.tests.test_coverage_edges.test_bad_lexical_cast_treated_as_binary", + "eval.tests.test_coverage_edges.test_mmap_blank_line_skipped", + "eval.tests.test_coverage_edges.test_mmap_progress_dots_at_milestones", + "eval.tests.test_coverage_edges.test_mmap_whitespace_only_line_reports_broken", + "eval.tests.test_coverage_edges.test_nommap_blank_line_skipped", + "eval.tests.test_coverage_edges.test_nommap_progress_dots_at_milestones", + "eval.tests.test_coverage_edges.test_predict_missing_input_file", + "eval.tests.test_cross_validation.test_cv_random_flag", + "eval.tests.test_cross_validation.test_cv_reports_percentage_format", + "eval.tests.test_cross_validation.test_cv_three_fold_too_small", + "eval.tests.test_cross_validation.test_cv_too_small_dataset", + "eval.tests.test_cross_validation.test_cv_two_fold_accuracy", + "eval.tests.test_cross_validation.test_cv_zero_is_training_mode", + "eval.tests.test_duplicate_options.test_duplicate_binary_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_cutoff_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_cv_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_detail_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_gaussian_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_gis_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_heldout_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_iter_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_lbfgs_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_nommap_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_output_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_predict_option_rejected", + "eval.tests.test_duplicate_options.test_duplicate_random_option_rejected", + "eval.tests.test_duplicate_options.test_long_option_with_double_dash_value", + "eval.tests.test_model_formats.test_binary_model_round_trip", + "eval.tests.test_model_formats.test_mmap_empty_file_errors_not_abort", + "eval.tests.test_model_formats.test_nommap_empty_file_asserts", + "eval.tests.test_model_formats.test_nommap_missing_file_reports_error", + "eval.tests.test_model_formats.test_text_and_binary_models_differ", + "eval.tests.test_predict.test_predict_broken_input_line", + "eval.tests.test_predict.test_predict_detail_output", + "eval.tests.test_predict.test_predict_missing_model_reports_error", + "eval.tests.test_predict.test_predict_nonexistent_model", + "eval.tests.test_predict.test_predict_output_file", + "eval.tests.test_predict.test_predict_prints_accuracy", + "eval.tests.test_predict.test_predict_unwritable_output", + "eval.tests.test_predict.test_train_then_test_two_inputs", + "eval.tests.test_training.test_broken_feature_line_in_nommap_data", + "eval.tests.test_training.test_broken_feature_line_in_nonbinary_data", + "eval.tests.test_training.test_colon_feature_data_trains", + "eval.tests.test_training.test_cutoff_option_controls_reduction", + "eval.tests.test_training.test_empty_data_file_mmap_fails", + "eval.tests.test_training.test_gaussian_prior_option_accepted", + "eval.tests.test_training.test_missing_input_file_reports_runtime_error", + "eval.tests.test_training.test_training_gis_method_selected", + "eval.tests.test_training.test_training_heldout_events", + "eval.tests.test_training.test_training_nommap_flag", + "eval.tests.test_training.test_training_prints_loading_and_stats", + "eval.tests.test_training.test_training_saves_model_file", + "eval.tests.test_training.test_training_without_model_warns_on_stderr" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_broken_lines.test_broken_line_reports_count_not_file_row", + "eval.tests.test_broken_lines.test_broken_weighted_line_mmap", + "eval.tests.test_broken_lines.test_broken_weighted_line_stream", + "eval.tests.test_broken_lines.test_predict_broken_weighted_line", + "eval.tests.test_broken_lines.test_whitespace_only_line_mmap_fails", + "eval.tests.test_cross_validation.test_cross_validation_rejects_undersized_data", + "eval.tests.test_cross_validation.test_cross_validation_reports_each_fold", + "eval.tests.test_cross_validation.test_cross_validation_stream_path", + "eval.tests.test_help_and_usage.test_help_usage_matches_golden_byte_for_byte", + "eval.tests.test_help_and_usage.test_missing_data_file_both_paths_exact_error", + "eval.tests.test_help_and_usage.test_no_input_emits_usage_and_fails", + "eval.tests.test_help_and_usage.test_predict_requires_model_exact_error", + "eval.tests.test_help_and_usage.test_unknown_flag_rejected_exactly", + "eval.tests.test_help_and_usage.test_version_emits_exact_string", + "eval.tests.test_load_events_mmap.test_mmap_loads_binary_events", + "eval.tests.test_load_events_mmap.test_mmap_loads_heldout_via_second_stream", + "eval.tests.test_load_events_mmap.test_mmap_loads_weighted_feature_events", + "eval.tests.test_load_events_mmap.test_mmap_of_directory_rejected_distinct_errno", + "eval.tests.test_load_events_mmap.test_mmap_progress_dots_every_1000", + "eval.tests.test_load_events_mmap.test_mmap_skips_blank_lines", + "eval.tests.test_load_events_mmap.test_mmap_zero_byte_file_fails", + "eval.tests.test_load_events_stream.test_stream_and_mmap_make_identical_training_counts", + "eval.tests.test_load_events_stream.test_stream_loads_binary_events", + "eval.tests.test_load_events_stream.test_stream_loads_weighted_events", + "eval.tests.test_load_events_stream.test_stream_progress_dots_every_1000", + "eval.tests.test_load_events_stream.test_stream_skips_blank_lines", + "eval.tests.test_predict.test_predict_detail_writes_distribution_rows", + "eval.tests.test_predict.test_predict_output_file_lists_one_prediction_per_line", + "eval.tests.test_predict.test_predict_streams_all_rows_and_accuracy" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cutoff_params.test_cutoff_above_event_counts_removes_everything", + "eval.tests.test_cutoff_params.test_cutoff_one_keeps_all_events", + "eval.tests.test_cutoff_params.test_large_outcome_build_params2", + "eval.tests.test_cutoff_params.test_merge_counts_and_cutoff_removes_singletons", + "eval.tests.test_cutoff_params.test_small_outcome_build_params_one_paramper_pair", + "eval.tests.test_cv_heldout.test_cross_validation_accuracy_is_percentage", + "eval.tests.test_cv_heldout.test_cross_validation_reports_fold_and_total_accuracy", + "eval.tests.test_cv_heldout.test_cross_validation_too_small_dataset_fails", + "eval.tests.test_cv_heldout.test_heldout_unseen_outcome_is_ignored", + "eval.tests.test_cv_heldout.test_random_cross_validation_shuffles_folds", + "eval.tests.test_error_paths.test_empty_input_file_fails_mmap", + "eval.tests.test_error_paths.test_help_flag_exits_zero", + "eval.tests.test_error_paths.test_missing_training_file_errors", + "eval.tests.test_error_paths.test_no_arguments_prints_help_and_fails", + "eval.tests.test_error_paths.test_predict_with_missing_model_file_errors", + "eval.tests.test_error_paths.test_predict_with_missing_test_file_errors", + "eval.tests.test_error_paths.test_predict_without_model_errors", + "eval.tests.test_heldout_gaussian_features.test_binary_model_save_and_reload", + "eval.tests.test_heldout_gaussian_features.test_gaussian_prior_enables_penalty", + "eval.tests.test_heldout_gaussian_features.test_gaussian_zero_disables_penalty", + "eval.tests.test_heldout_gaussian_features.test_heldout_events_reported", + "eval.tests.test_heldout_gaussian_features.test_heldout_new_feature_kept_event_discards_feature", + "eval.tests.test_heldout_gaussian_features.test_real_valued_features_trained", + "eval.tests.test_prediction.test_predict_detail_distribution_sums_to_one", + "eval.tests.test_prediction.test_predict_detail_has_all_outcomes_per_line", + "eval.tests.test_prediction.test_predict_emits_accuracy_percentage", + "eval.tests.test_prediction.test_predict_non_detail_writes_label_per_line", + "eval.tests.test_prediction.test_predict_without_output_file_writes_to_stdout_only_accuracy", + "eval.tests.test_prediction.test_real_valued_test_file_predict_distribution", + "eval.tests.test_prediction.test_train_then_save_load_then_predict_roundtrip", + "eval.tests.test_training.test_gis_estimator_branch_selected", + "eval.tests.test_training.test_nommap_reader_trains_same_model", + "eval.tests.test_training.test_train_reports_event_and_structure_counts", + "eval.tests.test_training.test_train_reports_parameter_count_matches_model_file", + "eval.tests.test_training.test_train_save_generates_text_model_file", + "eval.tests.test_training.test_train_then_predict_test_inline_single_process" + ] + }, + "generated_module_05": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_trainer_exact_oracles.test_detail_prediction_bytes_exact", + "eval.tests.test_trainer_exact_oracles.test_gis_gaussian_table_exact", + "eval.tests.test_trainer_exact_oracles.test_gis_iteration_table_exact", + "eval.tests.test_trainer_exact_oracles.test_lbfgs_fallback_combined_gaussian_verbose", + "eval.tests.test_trainer_exact_oracles.test_saved_text_model_bytes_exact", + "eval.tests.test_trainer_exact_oracles.test_trainer_probe_no_dump_events_flag", + "eval.tests.test_trainer_module.test_binary_model_save_is_deterministic_roundtrip", + "eval.tests.test_trainer_module.test_cross_validation_too_small_errors", + "eval.tests.test_trainer_module.test_cutoff_to_empty_aborts_in_init_trainer", + "eval.tests.test_trainer_module.test_empty_input_aborts_on_empty_model", + "eval.tests.test_trainer_module.test_gis_heldout_reports_unsupported", + "eval.tests.test_trainer_module.test_gis_training_default_iter_no_model_arg_warns", + "eval.tests.test_trainer_module.test_gis_training_gaussian_changes_parameters", + "eval.tests.test_trainer_module.test_gis_training_max_iteration_cap_honored", + "eval.tests.test_trainer_module.test_gis_training_writes_predictable_model", + "eval.tests.test_trainer_module.test_help_lists_training_switches", + "eval.tests.test_trainer_module.test_lbfgs_flag_falls_back_to_gis_with_notice", + "eval.tests.test_trainer_module.test_missing_prediction_input_errors", + "eval.tests.test_trainer_module.test_missing_training_input_errors", + "eval.tests.test_trainer_module.test_predict_stderr_accuracy_trailer", + "eval.tests.test_trainer_module.test_predict_without_model_errors", + "eval.tests.test_trainer_module.test_real_valued_features_train" + ] + }, + "generated_module_06": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_progress_reporting.test_progress_dot_suppressed_when_not_verbose", + "eval.tests.test_progress_reporting.test_verbose_large_file_emits_progress_dot", + "eval.tests.test_progress_reporting.test_verbose_model_save_exact_output_and_file", + "eval.tests.test_progress_reporting.test_verbose_nommap_emits_progress_dot", + "eval.tests.test_verbose_display.test_gis_parameter_header_prints_under_verbose", + "eval.tests.test_verbose_display.test_help_output_matches_golden", + "eval.tests.test_verbose_display.test_long_flag_verbose_matches_short_flag", + "eval.tests.test_verbose_display.test_progress_dot_absent_without_verbose", + "eval.tests.test_verbose_display.test_second_verbal_run_is_stable", + "eval.tests.test_verbose_display.test_verbose_training_stdout_matches_golden", + "eval.tests.test_verbose_display.test_without_verbose_suppresses_display_output" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_events_and_prediction.test_empty_context_predicts_uniform_distribution", + "eval.tests.test_events_and_prediction.test_gistrainer_loads_upstream_event_file", + "eval.tests.test_events_and_prediction.test_label_prediction_returns_highest_probability_outcome", + "eval.tests.test_events_and_prediction.test_random_field_model_is_not_a_maxent_model", + "eval.tests.test_modelfile.test_binary_model_saved_as_binary_and_roundtrips", + "eval.tests.test_modelfile.test_saved_text_model_matches_structural_golden", + "eval.tests.test_modelfile.test_text_and_binary_models_differ_on_disk", + "eval.tests.test_modelfile.test_text_model_roundtrip_preserves_distribution", + "eval.tests.test_training.test_gaussian_prior_enables_penalty_and_changes_convergence", + "eval.tests.test_training.test_gis_training_converges_to_expected_distribution", + "eval.tests.test_training.test_gis_training_iteration_record_is_deterministic", + "eval.tests.test_training.test_heldout_events_reported_and_monitored", + "eval.tests.test_upstream_models.test_me_gis_train2_loads_as_training_events", + "eval.tests.test_upstream_models.test_me_model2_predicts_symmetric_0204", + "eval.tests.test_upstream_models.test_me_model_predicts_softmax_of_known_theta" + ] + } + }, + "commit": "3560c94b737d4272ed86de529e50d823200e6d8e", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 2.59492266271699, + "eval_clean_hashes": [ + "0f7b79ab1dc65b415a6001074f1e1b1acec6e925b63a0a914e70c4d98a44f3fb" + ], + "input_record": { + "commit": "3560c94b737d4272ed86de529e50d823200e6d8e", + "full_name": "lzhang10/maxent", + "input_joern_zip": "cpp_joern/lzhang10__maxent.zip", + "joern_status": true, + "joern_time": 9.259669786086306, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 31, + "similarity": 0.5801087617874146 + }, + { + "pb_fullname": "facebookresearch/fastText", + "rank": 79, + "similarity": 0.5682306289672852 + } + ], + "repo_path": "cpp/lzhang10__maxent", + "source": "commit:3560c94b737d4272ed86de529e50d823200e6d8e", + "status": "done", + "url": "https://github.com/lzhang10/maxent" + }, + "instance_id": "lzhang10__maxent.3560c94", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 6, + "branch_name": "generated_module_01", + "iteration_limit": 10, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_02", + "iteration_limit": 10, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 10, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 10, + "branch_name": "generated_module_04", + "iteration_limit": 10, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 9, + "branch_name": "generated_module_05", + "iteration_limit": 10, + "module_index": 5, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_06", + "iteration_limit": 10, + "module_index": 6, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 6, + "branch_name": "generated_upstream", + "iteration_limit": 10, + "module_index": 7, + "module_kind": "tests", + "termination_reason": "early_stopping" + } + ], + "repository": "lzhang10/maxent" +} diff --git a/lzhang10--maxent.3560c94/tests/test.sh b/lzhang10--maxent.3560c94/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/lzhang10--maxent.3560c94/tests/workspace.tar.gz b/lzhang10--maxent.3560c94/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..37e7d6c37178389cd6fa4ee0ad650b65a437f711 --- /dev/null +++ b/lzhang10--maxent.3560c94/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e01822deeef4d90604500eff673b12570b4410db1009c7c5b9b19e06a26a5f6 +size 32288 diff --git a/m-manu--go-find-duplicates.cd928/environment/Dockerfile b/m-manu--go-find-duplicates.cd928/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/m-manu--go-find-duplicates.cd928/environment/download.sh b/m-manu--go-find-duplicates.cd928/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..0e0b83f85edd01a6a4fcee219df8ff198af6139b --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/environment/download.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/m-manu/go-find-duplicates + +go 1.22 + +require ( + github.com/deckarep/golang-set/v2 v2.7.0 + github.com/emirpasic/gods v1.18.1 + github.com/spf13/pflag v1.0.6 + github.com/stretchr/testify v1.10.0 + golang.org/x/text v0.22.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.7.0 h1:gIloKvD7yH2oip4VLhsv3JyLLFnC0Y2mlusgcvJYW5k= +github.com/deckarep/golang-set/v2 v2.7.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/m-manu--go-find-duplicates.cd928/environment/executable b/m-manu--go-find-duplicates.cd928/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..9985b58516c226c6326b8c1a8480b050e0676483 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9559aa50de111417596eb08a2bc6540cd5a9ca3f78c9a0405a715f0467d1fc9 +size 4057451 diff --git a/m-manu--go-find-duplicates.cd928/environment/programgym-go.tar.gz b/m-manu--go-find-duplicates.cd928/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/m-manu--go-find-duplicates.cd928/environment/workspace.tar.gz b/m-manu--go-find-duplicates.cd928/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e9d7109b089ed45b8d75dcfad5c8562df501d48 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cc1c4665ed62a7dbac3070d3763bb5056857743e6c3a07e21796a1edf37229e +size 2392 diff --git a/m-manu--go-find-duplicates.cd928/instruction.md b/m-manu--go-find-duplicates.cd928/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/m-manu--go-find-duplicates.cd928/solution/solve.sh b/m-manu--go-find-duplicates.cd928/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/m-manu--go-find-duplicates.cd928/task.toml b/m-manu--go-find-duplicates.cd928/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7c7eae09774d937ea09c864aeec130844ee7e3f4 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/m-manu--go-find-duplicates.cd928" +description = "Synthetic ProgramGym cleanroom reconstruction task for m-manu/go-find-duplicates" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "m-manu__go-find-duplicates.cd928ba" +repository = "m-manu/go-find-duplicates" +commit = "cd928ba207ba7b78d939597eb48590b1e78b52c6" +language = "go" +difficulty = "easy" +difficulty_score = 1.9828137621318622 +test_branches = 4 +test_count = 289 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/m-manu--go-find-duplicates.cd928/tests/Dockerfile b/m-manu--go-find-duplicates.cd928/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_01.tar.gz b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..979d86a480a38ea823e83bb024b7b57f7a42efd2 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f34a5d9a3b36cff8e962d1dde12d047981e142d09152492aa866703c0c2ac32 +size 10587 diff --git a/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_02.tar.gz b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b78ccab7804520b630786c452b75ae625479d328 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9cb8fc19b5d798de8909717263c51d584fb8ea685c8bcdf333eca7ba630d148 +size 13415 diff --git a/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_03.tar.gz b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..404c56783b4eaa3eca277705080d54454911a18d --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3134234ffcdfb8e3d24074234077c5464d3e0fd78a94ab23b4ec2b8d2541d1 +size 9655 diff --git a/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_04.tar.gz b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..80dba063a38f6d1ae4f7de464059651ce8dd731a --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18d003534a1a5d86c1afdc4630d063ad2877a9e6d025ddd7996873ff522f2a10 +size 11467 diff --git a/m-manu--go-find-duplicates.cd928/tests/download.sh b/m-manu--go-find-duplicates.cd928/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..0e0b83f85edd01a6a4fcee219df8ff198af6139b --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/download.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/m-manu/go-find-duplicates + +go 1.22 + +require ( + github.com/deckarep/golang-set/v2 v2.7.0 + github.com/emirpasic/gods v1.18.1 + github.com/spf13/pflag v1.0.6 + github.com/stretchr/testify v1.10.0 + golang.org/x/text v0.22.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.7.0 h1:gIloKvD7yH2oip4VLhsv3JyLLFnC0Y2mlusgcvJYW5k= +github.com/deckarep/golang-set/v2 v2.7.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/m-manu--go-find-duplicates.cd928/tests/executable b/m-manu--go-find-duplicates.cd928/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..9985b58516c226c6326b8c1a8480b050e0676483 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9559aa50de111417596eb08a2bc6540cd5a9ca3f78c9a0405a715f0467d1fc9 +size 4057451 diff --git a/m-manu--go-find-duplicates.cd928/tests/programgym-go.tar.gz b/m-manu--go-find-duplicates.cd928/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/m-manu--go-find-duplicates.cd928/tests/programgym_evaluator.py b/m-manu--go-find-duplicates.cd928/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/m-manu--go-find-duplicates.cd928/tests/programgym_task.json b/m-manu--go-find-duplicates.cd928/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..e0e9de9c5c07d161197533a2d84e24151902228e --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/programgym_task.json @@ -0,0 +1,410 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_entry.TestArgumentValidation.test_empty_string_as_input_directory", + "eval.tests.test_cli_entry.TestArgumentValidation.test_flag_missing_value_exits_2[exclusions]", + "eval.tests.test_cli_entry.TestArgumentValidation.test_flag_missing_value_exits_2[minsize]", + "eval.tests.test_cli_entry.TestArgumentValidation.test_flag_missing_value_exits_2[output]", + "eval.tests.test_cli_entry.TestArgumentValidation.test_flag_missing_value_exits_2[outputfile]", + "eval.tests.test_cli_entry.TestArgumentValidation.test_flag_missing_value_exits_2[parallelism]", + "eval.tests.test_cli_entry.TestArgumentValidation.test_invalid_named_input_directory_reports_index", + "eval.tests.test_cli_entry.TestArgumentValidation.test_no_input_directories_exits_invalid_num_args", + "eval.tests.test_cli_entry.TestArgumentValidation.test_nonexistent_input_directory", + "eval.tests.test_cli_entry.TestArgumentValidation.test_regular_file_as_input_directory", + "eval.tests.test_cli_entry.TestExclusionsFlag.test_exclusions_file_missing[absent_file]", + "eval.tests.test_cli_entry.TestExclusionsFlag.test_exclusions_file_missing[relative_absent]", + "eval.tests.test_cli_entry.TestExclusionsFlag.test_exclusions_file_with_crlf_conversion", + "eval.tests.test_cli_entry.TestExclusionsFlag.test_exclusions_path_is_directory", + "eval.tests.test_cli_entry.TestExclusionsFlag.test_exclusions_valid_file_is_accepted", + "eval.tests.test_cli_entry.TestHelpAndVersion.test_help_long_flag_prints_usage", + "eval.tests.test_cli_entry.TestHelpAndVersion.test_help_returns_before_scanning", + "eval.tests.test_cli_entry.TestHelpAndVersion.test_help_short_flag", + "eval.tests.test_cli_entry.TestHelpAndVersion.test_version_does_not_scan_directory", + "eval.tests.test_cli_entry.TestHelpAndVersion.test_version_prints_version", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_invalid_output_mode_exits_and_reports[bogus]", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_invalid_output_mode_exits_and_reports[empty]", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_invalid_output_mode_exits_and_reports[prefix]", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_invalid_output_mode_exits_and_reports[suffix]", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_invalid_output_mode_exits_and_reports[typo]", + "eval.tests.test_cli_entry.TestInvalidOutputMode.test_output_mode_case_insensitive_and_trimmed", + "eval.tests.test_cli_entry.TestMultipleDirectories.test_duplicates_across_directories", + "eval.tests.test_cli_entry.TestOutputFileFlag.test_outputfile_nonexistent_directory_exits", + "eval.tests.test_cli_entry.TestOutputFileFlag.test_outputfile_overwrites_existing_file", + "eval.tests.test_cli_entry.TestOutputFileFlag.test_outputfile_writes_to_specified_path", + "eval.tests.test_cli_entry.TestParallelism.test_parallelism_default_runs", + "eval.tests.test_cli_entry.TestParallelism.test_parallelism_values[one]", + "eval.tests.test_cli_entry.TestParallelism.test_parallelism_values[two]", + "eval.tests.test_cli_entry.TestParallelism.test_parallelism_values[zero]", + "eval.tests.test_extra.TestFormatWithCustomFile.test_csv_to_custom_outputfile", + "eval.tests.test_extra.TestFormatWithCustomFile.test_json_to_custom_outputfile", + "eval.tests.test_extra.TestFormatWithCustomFile.test_text_to_custom_outputfile_format_respected", + "eval.tests.test_extra.TestMalformedFlags.test_missing_value_for_minsize_flag", + "eval.tests.test_extra.TestMalformedFlags.test_non_numeric_flag_values_exit_2[minsize_alpha]", + "eval.tests.test_extra.TestMalformedFlags.test_non_numeric_flag_values_exit_2[minsize_negative]", + "eval.tests.test_extra.TestMalformedFlags.test_non_numeric_flag_values_exit_2[parallelism_alpha]", + "eval.tests.test_extra.TestMalformedFlags.test_non_numeric_flag_values_exit_2[parallelism_negative]", + "eval.tests.test_extra.TestMalformedFlags.test_parallelism_out_of_uint8_range", + "eval.tests.test_extra.TestMultiDirectoryEdge.test_one_empty_directory_among_scan", + "eval.tests.test_extra.TestMultiGroup.test_csv_is_structurally_parseable", + "eval.tests.test_extra.TestMultiGroup.test_csv_report_multiple_groups_row_count", + "eval.tests.test_extra.TestMultiGroup.test_json_report_multiple_entries", + "eval.tests.test_extra.TestRecursion.test_excluded_directory_subtree_is_skipped", + "eval.tests.test_extra.TestRecursion.test_nested_directory_is_scanned_recursively", + "eval.tests.test_extra.TestReportFileSideEffects.test_custom_outputfile_adds_no_runid_file", + "eval.tests.test_extra.TestReportFileSideEffects.test_empty_directory_still_creates_empty_report", + "eval.tests.test_extra.TestReportFileSideEffects.test_print_mode_creates_no_report_file", + "eval.tests.test_extra.TestReportFileSideEffects.test_text_report_file_created_even_without_duplicates", + "eval.tests.test_extra.TestStreamSeparation.test_errors_go_to_stderr", + "eval.tests.test_extra.TestStreamSeparation.test_help_usage_goes_to_stdout", + "eval.tests.test_extra.TestStreamSeparation.test_progress_goes_to_stdout", + "eval.tests.test_reports.TestCsvReport.test_csv_report_excludes_unique_file", + "eval.tests.test_reports.TestCsvReport.test_csv_report_header_and_rows", + "eval.tests.test_reports.TestCsvReport.test_csv_report_last_modified_is_formatted", + "eval.tests.test_reports.TestCsvReport.test_csv_report_size_column_is_bytes", + "eval.tests.test_reports.TestExclusionFiltering.test_default_exclusions_skip_ds_store", + "eval.tests.test_reports.TestExclusionFiltering.test_exclusion_by_filename_hides_duplicate", + "eval.tests.test_reports.TestJsonReport.test_json_report_is_valid_json_array", + "eval.tests.test_reports.TestJsonReport.test_json_report_paths_include_duplicates", + "eval.tests.test_reports.TestJsonReport.test_json_report_thorough_hash_is_sha256_length", + "eval.tests.test_reports.TestMinSize.test_minsize_at_threshold_includes_file", + "eval.tests.test_reports.TestMinSize.test_minsize_explicit_threshold_skips_smaller", + "eval.tests.test_reports.TestMinSize.test_minsize_zero_includes_all", + "eval.tests.test_reports.TestMinSize.test_tiny_files_ignored_at_default_minsize", + "eval.tests.test_reports.TestPrintMode.test_print_mode_with_max_parallelism", + "eval.tests.test_reports.TestPrintMode.test_print_report_has_run_id_header", + "eval.tests.test_reports.TestQuietMode.test_quiet_still_reports_errors", + "eval.tests.test_reports.TestQuietMode.test_quiet_suppresses_progress_but_not_report", + "eval.tests.test_reports.TestStatusMessages.test_empty_directory_no_actions", + "eval.tests.test_reports.TestStatusMessages.test_files_but_no_duplicates_message", + "eval.tests.test_reports.TestStatusMessages.test_success_shows_scan_messages", + "eval.tests.test_reports.TestTextReport.test_text_report_contains_digest_line", + "eval.tests.test_reports.TestTextReport.test_text_report_duplicate_count_is_copies", + "eval.tests.test_reports.TestTextReport.test_text_report_multiple_groups", + "eval.tests.test_reports.TestTextReport.test_text_report_orders_paths_sorted", + "eval.tests.test_reports.TestTextReport.test_text_report_shows_savings_message", + "eval.tests.test_reports.TestThoroughMode.test_thorough_hash_is_longer_than_crc" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_errors.test_bad_exclusions_file_exit_code_and_message", + "eval.tests.test_cli_errors.test_exclusions_argument_that_is_a_directory_rejected", + "eval.tests.test_cli_errors.test_help_flag_exits_zero_and_prints_flags", + "eval.tests.test_cli_errors.test_help_short_flag_matches_long", + "eval.tests.test_cli_errors.test_invalid_output_mode_exit_code_and_message", + "eval.tests.test_cli_errors.test_no_arg_gives_invalid_num_args_and_usage", + "eval.tests.test_cli_errors.test_output_file_dir_unreadable_exit_code", + "eval.tests.test_cli_errors.test_quiet_flag_suppresses_progress_stdout", + "eval.tests.test_cli_errors.test_second_dir_invalid_reports_index_2", + "eval.tests.test_cli_errors.test_unreadable_input_directory_extracts_index[-1]", + "eval.tests.test_cli_errors.test_unreadable_input_directory_extracts_index[/nonexistent/definitely_missing_dir-3]", + "eval.tests.test_cli_errors.test_version_flag_prints_version_string_and_exits_zero", + "eval.tests.test_dir_scanning.test_duplicates_found_in_single_and_across_directories[False]", + "eval.tests.test_dir_scanning.test_duplicates_found_in_single_and_across_directories[True]", + "eval.tests.test_dir_scanning.test_empty_directory_no_actions_message", + "eval.tests.test_dir_scanning.test_min_size_threshold_boundary[1-4-False]", + "eval.tests.test_dir_scanning.test_min_size_threshold_boundary[4-4-True]", + "eval.tests.test_dir_scanning.test_min_size_threshold_boundary[8-4-True]", + "eval.tests.test_dir_scanning.test_presence_of_no_duplicates_message_on_unique_files", + "eval.tests.test_dir_scanning.test_scan_reports_file_count_and_total_size_on_stdout", + "eval.tests.test_dir_scanning.test_single_file_no_duplicates", + "eval.tests.test_exclusions.test_apple_double_dot_files_are_skipped", + "eval.tests.test_exclusions.test_custom_exclusions_override_defaults", + "eval.tests.test_exclusions.test_default_builtin_exclusion_applied_without_x_flag", + "eval.tests.test_exclusions.test_exclusion_name_applies_across_all_scanned_dirs", + "eval.tests.test_exclusions.test_exclusions_file_removes_named_directory_entirely", + "eval.tests.test_exclusions.test_exclusions_file_removes_named_file", + "eval.tests.test_ext_handling.test_files_without_extension_group_by_empty_extension[A-B]", + "eval.tests.test_ext_handling.test_files_without_extension_group_by_empty_extension[makefile-config]", + "eval.tests.test_ext_handling.test_symlinks_are_not_scanned_as_regular_files", + "eval.tests.test_ext_handling.test_uppercase_and_lowercase_extension_normalized_together", + "eval.tests.test_ext_handling.test_uppercase_differs_from_other_extension", + "eval.tests.test_grouping.test_duplicate_count_equals_copies_minus_one[2-1]", + "eval.tests.test_grouping.test_duplicate_count_equals_copies_minus_one[3-2]", + "eval.tests.test_grouping.test_duplicate_count_equals_copies_minus_one[4-3]", + "eval.tests.test_grouping.test_grouping_requires_same_extension", + "eval.tests.test_grouping.test_grouping_requires_same_hash_different_content", + "eval.tests.test_grouping.test_grouping_requires_same_size", + "eval.tests.test_grouping.test_many_identical_copies_all_grouped_together", + "eval.tests.test_grouping.test_parallelism_values_do_not_change_results[0]", + "eval.tests.test_grouping.test_parallelism_values_do_not_change_results[1]", + "eval.tests.test_grouping.test_parallelism_values_do_not_change_results[2]", + "eval.tests.test_grouping.test_samesize_diff_content_become_duplicates_when_identical", + "eval.tests.test_grouping.test_savings_sum_across_two_groups", + "eval.tests.test_grouping.test_subdirectory_files_are_scanned_recursively", + "eval.tests.test_grouping.test_two_separate_duplicate_groups", + "eval.tests.test_hashing.test_digest_keyed_by_ext_size_hash_keeps_same_content_together", + "eval.tests.test_hashing.test_duplicate_grouping_by_digest_json_shape", + "eval.tests.test_hashing.test_large_file_crucial_bytes_hash_is_exact", + "eval.tests.test_hashing.test_large_files_with_different_content_get_different_hashes", + "eval.tests.test_hashing.test_prefix_boundary_on_large_files[16384-f]", + "eval.tests.test_hashing.test_prefix_boundary_on_large_files[16385-s]", + "eval.tests.test_hashing.test_prefix_boundary_on_large_files[32768-s]", + "eval.tests.test_hashing.test_small_file_uses_crc32_full_read_prefix_f", + "eval.tests.test_hashing.test_thorough_and_non_thorough_agree_on_duplicate_membership", + "eval.tests.test_hashing.test_thorough_mode_uses_sha256_no_prefix", + "eval.tests.test_reports.test_csv_report_has_header_and_duplicate_rows", + "eval.tests.test_reports.test_default_report_file_created_in_cwd_when_no_outputfile", + "eval.tests.test_reports.test_empty_scan_writes_no_report_file_in_print_mode", + "eval.tests.test_reports.test_json_report_has_digest_and_paths", + "eval.tests.test_reports.test_print_mode_writes_report_to_stdout_not_file", + "eval.tests.test_reports.test_text_report_lists_duplicate_count_and_paths", + "eval.tests.test_reports.test_total_savings_and_count_line", + "eval.tests.test_scan_edges.test_exclusions_file_tolerates_blank_lines_and_leading_whitespace", + "eval.tests.test_scan_edges.test_min_size_above_default_removes_default_eligible_files", + "eval.tests.test_scan_edges.test_nonzero_minsize_excludes_empty_files", + "eval.tests.test_scan_edges.test_same_directory_passed_twice_dedupes_file_paths", + "eval.tests.test_scan_edges.test_zero_minsize_includes_empty_files" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_paths.test_help_long_flag_exits_zero", + "eval.tests.test_cli_paths.test_help_short_flag_exits_zero", + "eval.tests.test_cli_paths.test_mixed_valid_and_invalid_directory_rejected", + "eval.tests.test_cli_paths.test_no_arguments_invalid_num_args_exit", + "eval.tests.test_cli_paths.test_outputfile_nonexistent_dir_rejected", + "eval.tests.test_cli_paths.test_outputfile_written_to_custom_path", + "eval.tests.test_cli_paths.test_parallelism_flag_accepted", + "eval.tests.test_cli_paths.test_parallelism_zero_uses_default_path", + "eval.tests.test_cli_paths.test_quiet_suppresses_argument_error_message", + "eval.tests.test_cli_paths.test_quiet_suppresses_stdout_scan_progress", + "eval.tests.test_cli_paths.test_unreadable_input_directory_exit", + "eval.tests.test_cli_paths.test_version_flag_prints_exact_version", + "eval.tests.test_duplicate_detection.test_different_content_same_size_and_ext_not_grouped", + "eval.tests.test_duplicate_detection.test_different_extension_not_grouped", + "eval.tests.test_duplicate_detection.test_different_size_not_grouped", + "eval.tests.test_duplicate_detection.test_empty_directory_no_actions_performed", + "eval.tests.test_duplicate_detection.test_exclusions_file_skips_matching_names", + "eval.tests.test_duplicate_detection.test_exclusions_missing_file_rejected", + "eval.tests.test_duplicate_detection.test_identical_size_content_extension_grouped", + "eval.tests.test_duplicate_detection.test_minsize_boundary_includes_exact_threshold_file", + "eval.tests.test_duplicate_detection.test_minsize_threshold_excludes_smaller_files", + "eval.tests.test_duplicate_detection.test_minsize_zero_keeps_even_two_byte_files", + "eval.tests.test_duplicate_detection.test_multiple_distinct_duplicate_groups_reported", + "eval.tests.test_duplicate_detection.test_multiple_input_directories_combined", + "eval.tests.test_duplicate_detection.test_single_non_duplicate_file_not_reported", + "eval.tests.test_duplicate_detection.test_thorough_and_default_hashes_differ", + "eval.tests.test_duplicate_detection.test_thorough_mode_uses_sha256_hash", + "eval.tests.test_duplicate_detection.test_three_copies_count_two_duplicates", + "eval.tests.test_entity_reports.test_all_four_output_modes_accepted", + "eval.tests.test_entity_reports.test_binary_size_rendered_in_bytes_below_kib", + "eval.tests.test_entity_reports.test_csv_report_has_header_and_all_fields", + "eval.tests.test_entity_reports.test_csv_timestamp_derived_from_file_mtime", + "eval.tests.test_entity_reports.test_empty_output_mode_rejected", + "eval.tests.test_entity_reports.test_explicit_outputfile_text_report_matches_print_format", + "eval.tests.test_entity_reports.test_groups_ordered_by_extension_descending_when_sizes_equal", + "eval.tests.test_entity_reports.test_groups_ordered_by_hash_descending_when_size_and_ext_equal", + "eval.tests.test_entity_reports.test_groups_ordered_by_size_descending", + "eval.tests.test_entity_reports.test_hash_has_f_prefix_for_small_files", + "eval.tests.test_entity_reports.test_hash_has_s_prefix_for_large_files", + "eval.tests.test_entity_reports.test_help_lists_every_output_mode", + "eval.tests.test_entity_reports.test_invalid_output_mode_rejected", + "eval.tests.test_entity_reports.test_json_report_multiple_groups_preserve_comparator_order", + "eval.tests.test_entity_reports.test_json_report_structure_embeds_filedigest", + "eval.tests.test_entity_reports.test_output_mode_is_case_and_space_normalized", + "eval.tests.test_entity_reports.test_print_digest_rendering_extension_hash_size", + "eval.tests.test_entity_reports.test_print_report_duplicate_count_is_extra_copies", + "eval.tests.test_entity_reports.test_print_report_lists_all_duplicate_paths", + "eval.tests.test_entity_reports.test_savings_counts_extra_copies_times_file_size", + "eval.tests.test_entity_reports.test_text_mode_writes_default_report_file_in_cwd" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[10000]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[1024]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[1025]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[1048575]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[2048]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[4096]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_kib_total[65536]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_mib_savings", + "eval.tests.test_bytesutil_binary_format.test_binary_format_multiple_groups_aggregated", + "eval.tests.test_bytesutil_binary_format.test_binary_format_repeats_for_each_duplicate", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[a]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[ab]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[xxxxx]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[yyyyyyyyyy]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_small_bytes_total_size[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]", + "eval.tests.test_bytesutil_binary_format.test_binary_format_zero_bytes", + "eval.tests.test_bytesutil_binary_format.test_minsize_kib_threshold[-0-True]", + "eval.tests.test_bytesutil_binary_format.test_minsize_kib_threshold[ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt-1-False]", + "eval.tests.test_bytesutil_binary_format.test_minsize_kib_threshold[uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu-1-True]", + "eval.tests.test_bytesutil_binary_format.test_minsize_kib_threshold[vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv-2-False]", + "eval.tests.test_bytesutil_binary_format.test_minsize_kib_threshold[wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww-2-True]", + "eval.tests.test_bytesutil_binary_format.test_summary_binary_format_consistency", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_aggregates_multiple_files", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_digest_line", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_duplicate_savings[1073741824]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_duplicate_savings[1800000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_duplicate_savings[3000000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_single_file_total[1073741824]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_single_file_total[1500000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_single_file_total[2200000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_single_file_total[3500000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_single_file_total[5000000000]", + "eval.tests.test_bytesutil_gib_tier.test_binary_format_gib_starts_above_mib_top", + "eval.tests.test_bytesutil_mib_switch_boundary.test_binary_format_exact_mib_switch", + "eval.tests.test_bytesutil_mib_switch_boundary.test_binary_format_mib_switch_boundary_just_below", + "eval.tests.test_bytesutil_mib_switch_boundary.test_binary_format_mib_switch_savings_exact", + "eval.tests.test_cli_reachability.test_custom_outputfile_flag_writes_named_file", + "eval.tests.test_cli_reachability.test_empty_directory_no_actions", + "eval.tests.test_cli_reachability.test_fast_mode_partial_hash", + "eval.tests.test_cli_reachability.test_file_output_modes_write_reports[csv-.csv]", + "eval.tests.test_cli_reachability.test_file_output_modes_write_reports[json-.json]", + "eval.tests.test_cli_reachability.test_file_output_modes_write_reports[text-.txt]", + "eval.tests.test_cli_reachability.test_help_exits_zero_and_lists_flags[--help]", + "eval.tests.test_cli_reachability.test_help_exits_zero_and_lists_flags[-h]", + "eval.tests.test_cli_reachability.test_multiple_duplicate_groups_reported", + "eval.tests.test_cli_reachability.test_multiple_input_directories_scan_together", + "eval.tests.test_cli_reachability.test_parallelism_flag_accepted", + "eval.tests.test_cli_reachability.test_parallelism_zero_uses_cpu_default", + "eval.tests.test_cli_reachability.test_runid_format_in_report", + "eval.tests.test_cli_reachability.test_stdout_print_mode_no_file_written", + "eval.tests.test_cli_reachability.test_thorough_mode_full_sha256_hash", + "eval.tests.test_cli_reachability.test_version_exits_zero[--version]", + "eval.tests.test_fmte_english_locale_grouping.test_duplicate_count_english_grouping", + "eval.tests.test_fmte_english_locale_grouping.test_english_grouping_boundary_from_both_lines[1001-1,001-1,000-True]", + "eval.tests.test_fmte_english_locale_grouping.test_english_grouping_boundary_from_both_lines[999-999-998-False]", + "eval.tests.test_fmte_english_locale_grouping.test_total_file_count_english_grouping[1000-1,000-True]", + "eval.tests.test_fmte_english_locale_grouping.test_total_file_count_english_grouping[1001-1,001-True]", + "eval.tests.test_fmte_english_locale_grouping.test_total_file_count_english_grouping[12345-12,345-True]", + "eval.tests.test_fmte_english_locale_grouping.test_total_file_count_english_grouping[1500-1,500-True]", + "eval.tests.test_fmte_english_locale_grouping.test_total_file_count_english_grouping[999-999-False]", + "eval.tests.test_fmte_english_printing.test_invalid_output_mode_message_uses_stdout", + "eval.tests.test_fmte_english_printing.test_printf_err_emits_error_with_usage_banner[args0-1-error: no input directories passed]", + "eval.tests.test_fmte_english_printing.test_printf_err_emits_error_with_usage_banner[args1-3-isn't a readable directory]", + "eval.tests.test_fmte_english_printing.test_printf_err_emits_error_with_usage_banner[args2-2-should be a readable file]", + "eval.tests.test_fmte_english_printing.test_printf_err_emits_error_without_usage_banner", + "eval.tests.test_fmte_english_printing.test_printf_prints_no_duplicates_when_unique", + "eval.tests.test_fmte_english_printing.test_printf_progress_lines_on_stdout", + "eval.tests.test_fmte_english_printing.test_quiet_suppresses_progress_but_keeps_report[--quiet]", + "eval.tests.test_fmte_english_printing.test_quiet_suppresses_progress_but_keeps_report[-q]", + "eval.tests.test_fmte_english_printing.test_quiet_suppresses_stderr_errors", + "eval.tests.test_utils_filesystem.test_custom_exclusions_blank_lines_ignored", + "eval.tests.test_utils_filesystem.test_custom_exclusions_skip_named_dir", + "eval.tests.test_utils_filesystem.test_custom_exclusions_skip_named_file", + "eval.tests.test_utils_filesystem.test_default_exclusions_skip_directory", + "eval.tests.test_utils_filesystem.test_default_exclusions_skip_file", + "eval.tests.test_utils_filesystem.test_get_file_ext_lowercases_extension[code.PNG-img.png-.png]", + "eval.tests.test_utils_filesystem.test_get_file_ext_lowercases_extension[doc.Md-doc2.md-.md]", + "eval.tests.test_utils_filesystem.test_get_file_ext_lowercases_extension[up.TXT-low.txt-.txt]", + "eval.tests.test_utils_filesystem.test_get_file_ext_no_extension", + "eval.tests.test_utils_filesystem.test_get_file_ext_separates_different_extensions", + "eval.tests.test_utils_filesystem.test_hidden_dot_underscore_file_skipped", + "eval.tests.test_utils_filesystem.test_is_readable_directory_accepts_output_dir", + "eval.tests.test_utils_filesystem.test_is_readable_directory_no_args", + "eval.tests.test_utils_filesystem.test_is_readable_directory_rejects_output_dir", + "eval.tests.test_utils_filesystem.test_is_readable_directory_validation[/etc/passwd]", + "eval.tests.test_utils_filesystem.test_is_readable_directory_validation[/no/such/dir]", + "eval.tests.test_utils_filesystem.test_is_readable_file_accepts_exclusions", + "eval.tests.test_utils_filesystem.test_is_readable_file_rejects_directory", + "eval.tests.test_utils_filesystem.test_is_readable_file_rejects_missing" + ] + } + }, + "commit": "cd928ba207ba7b78d939597eb48590b1e78b52c6", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9828137621318622, + "eval_clean_hashes": [ + "e9559aa50de111417596eb08a2bc6540cd5a9ca3f78c9a0405a715f0467d1fc9" + ], + "input_record": { + "commit": "cd928ba207ba7b78d939597eb48590b1e78b52c6", + "commits": 29, + "contributors": 3, + "difficulty": "easy", + "difficulty_code_lines": 1068, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1068, + "difficulty_runtime_deps": 8, + "difficulty_score": 1.9828137621318622, + "difficulty_test_code_lines": 120, + "full_name": "m-manu/go-find-duplicates", + "github_stars": 297, + "input_joern_zip": "go_joern/m-manu__go-find-duplicates.zip", + "joern_status": true, + "joern_time": 8.767229082994163, + "language": "go", + "pb_match": [ + { + "pb_fullname": "mibk/dupl", + "rank": 184, + "similarity": 0.5761905908584595 + }, + { + "pb_fullname": "FiloSottile/age", + "rank": 831, + "similarity": 0.45385289192199707 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 674, + "similarity": 0.48963770270347595 + }, + { + "pb_fullname": "junegunn/fzf", + "rank": 105, + "similarity": 0.539344310760498 + } + ], + "repo_age": 5.15, + "repo_path": "go/m-manu__go-find-duplicates", + "source": "commit:cd928ba207ba7b78d939597eb48590b1e78b52c6", + "status": "done", + "url": "https://github.com/m-manu/go-find-duplicates" + }, + "instance_id": "m-manu__go-find-duplicates.cd928ba", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "m-manu/go-find-duplicates" +} diff --git a/m-manu--go-find-duplicates.cd928/tests/test.sh b/m-manu--go-find-duplicates.cd928/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/m-manu--go-find-duplicates.cd928/tests/workspace.tar.gz b/m-manu--go-find-duplicates.cd928/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e9d7109b089ed45b8d75dcfad5c8562df501d48 --- /dev/null +++ b/m-manu--go-find-duplicates.cd928/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cc1c4665ed62a7dbac3070d3763bb5056857743e6c3a07e21796a1edf37229e +size 2392 diff --git a/m-ou-se--inline-python.635617f/environment/Dockerfile b/m-ou-se--inline-python.635617f/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/m-ou-se--inline-python.635617f/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/m-ou-se--inline-python.635617f/environment/download.sh b/m-ou-se--inline-python.635617f/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4e976d3176e52ca0bcecf732163c935b161aab9 --- /dev/null +++ b/m-ou-se--inline-python.635617f/environment/download.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# download.sh +# ProgramGym offline-dependency prefetch for m-ou-se/inline-python. +# +# This script is STANDALONE and sourced via `source /source_ro/download.sh`. +# It must not read any repository file (Cargo.toml / Cargo.lock / etc.), must +# not probe the Rust toolchain, and only prefetches Cargo dependencies into the +# shared CARGO_HOME registry cache. No compile/link/test step is performed here. +set -u + +# Helper to fail cleanly whether the script is sourced or executed. +_fail() { + echo "download.sh: error: $1" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# cargo is guaranteed present in the base image; no probing of it here. + +# --------------------------------------------------------------------------- +# Generate a temporary Cargo manifest that reproduces the exact dependency +# closure the offline build needs. The selected target is the `context` example +# (kind=example, target/release/examples/context, built from examples/Cargo.toml). +# Its build graph resolves through inline-python and inline-python-macros, both +# of which depend on pyo3 0.25 with default-features disabled and the +# "auto-initialize" feature; the examples package itself adds a plain +# `pyo3 = "0.25"` dependency (default features on). A self-contained package +# mirroring pyo3 0.25 with default features plus "auto-initialize" prefetches the +# identical transitive closure so the offline cargo build in build.sh resolves +# every crate from the pre-warmed cache. +# +# All manifest content is inline here; no repository file is read. +# --------------------------------------------------------------------------- +WORK="$(mktemp -d "/tmp/inline_python_download.XXXXXX")" + +if [ -z "$WORK" ]; then + _fail "could not create a temporary working directory" +fi + +cat > "$WORK/Cargo.toml" <<'EOF' +[package] +name = "programgym-inline-python-prefetch" +version = "0.0.0" +edition = "2021" + +# Mirror of the pyo3 dependency resolved by the `context` example build: +# default features (from examples/Cargo.toml `pyo3 = "0.25"`) plus the +# "auto-initialize" feature (from inline-python and inline-python-macros). +[dependencies] +pyo3 = { version = "0.25", features = ["auto-initialize"] } +EOF + +mkdir -p "$WORK/src" +printf 'fn main() {}\n' > "$WORK/src/main.rs" + +# --------------------------------------------------------------------------- +# Prefetch dependencies via --manifest-path, pointing cargo directly at the +# generated manifest under /tmp. We never cd into /source_ro or the repository +# root: cargo only ever reads the generated manifest and writes into the default +# CARGO_HOME cache. Nothing is compiled here. +# --------------------------------------------------------------------------- +if ! cargo fetch --manifest-path "$WORK/Cargo.toml"; then + _fail "dependency prefetch via the generated manifest failed" +fi + +# Registry index and crate cache are now in the default CARGO_HOME and are +# reusable by the offline build in build.sh. + +rm -rf "$WORK" + +echo "download.sh: prefetched cargo dependencies successfully" diff --git a/m-ou-se--inline-python.635617f/environment/executable b/m-ou-se--inline-python.635617f/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..85333a4eb93f5b9eeaf0f577723efa6269ce6392 --- /dev/null +++ b/m-ou-se--inline-python.635617f/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31585b7c51deedcffc55ef5244a0f86071cbc69c8fa56b6ea55ca99e8797c325 +size 565768 diff --git a/m-ou-se--inline-python.635617f/environment/harbor_prepare_download_env.sh b/m-ou-se--inline-python.635617f/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/m-ou-se--inline-python.635617f/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m-ou-se--inline-python.635617f/environment/workspace.tar.gz b/m-ou-se--inline-python.635617f/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fb8d933537a7534d5c363e89cfb028eb18e3ec23 --- /dev/null +++ b/m-ou-se--inline-python.635617f/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39f6eefb62f05bf11726d1d70b01d4cef46f67940756b788e12580f3eff2dca4 +size 2267 diff --git a/m-ou-se--inline-python.635617f/instruction.md b/m-ou-se--inline-python.635617f/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/m-ou-se--inline-python.635617f/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/m-ou-se--inline-python.635617f/solution/solve.sh b/m-ou-se--inline-python.635617f/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/m-ou-se--inline-python.635617f/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/m-ou-se--inline-python.635617f/task.toml b/m-ou-se--inline-python.635617f/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7dd1bff21ff65539b2a8c12790a3869701a1150c --- /dev/null +++ b/m-ou-se--inline-python.635617f/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/m-ou-se--inline-python.635617f" +description = "Synthetic ProgramGym cleanroom reconstruction task for m-ou-se/inline-python" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "m-ou-se__inline-python.635617f" +repository = "m-ou-se/inline-python" +commit = "635617f217e621a1655adb148800e1f4e1d11243" +language = "rust" +difficulty = "easy" +difficulty_score = 1.5351674851149442 +test_branches = 4 +test_count = 307 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/m-ou-se--inline-python.635617f/tests/Dockerfile b/m-ou-se--inline-python.635617f/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_01.tar.gz b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0527523c9f826194bb1f442407338f2b4ac65d46 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:226c0765f167c6a78f6dc9205ccf4ab61286ad903864b05932c286581c970e09 +size 18910 diff --git a/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_02.tar.gz b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d521d362770422c116e1e76877ab2da6abd58977 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b5238faf925ce172a28314de1e25dae318268bfe2b897cce718747047c2cfb3 +size 12554 diff --git a/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_03.tar.gz b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..19f2500d2918d786adea8f7c946d515c4d62b37e --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e7ffe7d58f36f73fd5823d301f797099bcdca21639bd76b8e93de6bb7db65cc +size 11856 diff --git a/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_upstream.tar.gz b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..df1886d1161bfcb4e8211bbd482b839c8efb5c5f --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:156a071c54c051932794fb3038da110069ef3d8ec13585d2c3fd4f8c836de7ad +size 1894 diff --git a/m-ou-se--inline-python.635617f/tests/download.sh b/m-ou-se--inline-python.635617f/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4e976d3176e52ca0bcecf732163c935b161aab9 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/download.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# download.sh +# ProgramGym offline-dependency prefetch for m-ou-se/inline-python. +# +# This script is STANDALONE and sourced via `source /source_ro/download.sh`. +# It must not read any repository file (Cargo.toml / Cargo.lock / etc.), must +# not probe the Rust toolchain, and only prefetches Cargo dependencies into the +# shared CARGO_HOME registry cache. No compile/link/test step is performed here. +set -u + +# Helper to fail cleanly whether the script is sourced or executed. +_fail() { + echo "download.sh: error: $1" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# cargo is guaranteed present in the base image; no probing of it here. + +# --------------------------------------------------------------------------- +# Generate a temporary Cargo manifest that reproduces the exact dependency +# closure the offline build needs. The selected target is the `context` example +# (kind=example, target/release/examples/context, built from examples/Cargo.toml). +# Its build graph resolves through inline-python and inline-python-macros, both +# of which depend on pyo3 0.25 with default-features disabled and the +# "auto-initialize" feature; the examples package itself adds a plain +# `pyo3 = "0.25"` dependency (default features on). A self-contained package +# mirroring pyo3 0.25 with default features plus "auto-initialize" prefetches the +# identical transitive closure so the offline cargo build in build.sh resolves +# every crate from the pre-warmed cache. +# +# All manifest content is inline here; no repository file is read. +# --------------------------------------------------------------------------- +WORK="$(mktemp -d "/tmp/inline_python_download.XXXXXX")" + +if [ -z "$WORK" ]; then + _fail "could not create a temporary working directory" +fi + +cat > "$WORK/Cargo.toml" <<'EOF' +[package] +name = "programgym-inline-python-prefetch" +version = "0.0.0" +edition = "2021" + +# Mirror of the pyo3 dependency resolved by the `context` example build: +# default features (from examples/Cargo.toml `pyo3 = "0.25"`) plus the +# "auto-initialize" feature (from inline-python and inline-python-macros). +[dependencies] +pyo3 = { version = "0.25", features = ["auto-initialize"] } +EOF + +mkdir -p "$WORK/src" +printf 'fn main() {}\n' > "$WORK/src/main.rs" + +# --------------------------------------------------------------------------- +# Prefetch dependencies via --manifest-path, pointing cargo directly at the +# generated manifest under /tmp. We never cd into /source_ro or the repository +# root: cargo only ever reads the generated manifest and writes into the default +# CARGO_HOME cache. Nothing is compiled here. +# --------------------------------------------------------------------------- +if ! cargo fetch --manifest-path "$WORK/Cargo.toml"; then + _fail "dependency prefetch via the generated manifest failed" +fi + +# Registry index and crate cache are now in the default CARGO_HOME and are +# reusable by the offline build in build.sh. + +rm -rf "$WORK" + +echo "download.sh: prefetched cargo dependencies successfully" diff --git a/m-ou-se--inline-python.635617f/tests/executable b/m-ou-se--inline-python.635617f/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..85333a4eb93f5b9eeaf0f577723efa6269ce6392 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31585b7c51deedcffc55ef5244a0f86071cbc69c8fa56b6ea55ca99e8797c325 +size 565768 diff --git a/m-ou-se--inline-python.635617f/tests/harbor_prepare_download_env.sh b/m-ou-se--inline-python.635617f/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m-ou-se--inline-python.635617f/tests/programgym_evaluator.py b/m-ou-se--inline-python.635617f/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/m-ou-se--inline-python.635617f/tests/programgym_task.json b/m-ou-se--inline-python.635617f/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..49b8ed64cfbcc6df94396570179c6daf3498d59d --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/programgym_task.json @@ -0,0 +1,537 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_python_macro.test_pythonioencoding_utf8_sig_prepends_bom", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_python_macro.test_pythonpycacheprefix_pointing_at_a_file_still_runs", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_python_macro.test_pythonstartup_file_not_executed_in_noninteractive_mode", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_python_macro.test_pythonuserbase_pointing_at_a_file_still_runs", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_python_macro.test_tty_stdout_line_buffers_without_pythonunbuffered", + "reasons": [ + { + "id": "try_except_swallow", + "message": "pytest test swallows exceptions in an except handler", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Do not swallow exceptions; let pytest fail or assert the exact expected exception.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_python_macro.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_python_macro.test_all_three_golden_lines_in_order", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[ascii]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[ascii_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[ascii_strict]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[latin1]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[latin1_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[latin1_strict]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[utf8]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[utf8_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_buffered_keeps_buffering[utf8_strict]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[ascii]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[ascii_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[ascii_strict]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[latin1]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[latin1_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[latin1_strict]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[utf8]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[utf8_replace]", + "eval.tests.test_python_macro.test_ascii_compatible_encoding_unbuffered_yields_golden[utf8_strict]", + "eval.tests.test_python_macro.test_broken_pythonhome_breaks_interpreter_init", + "eval.tests.test_python_macro.test_buffered_mode_stdout_empty_but_exit_zero", + "eval.tests.test_python_macro.test_closed_stdin_fd_still_runs", + "eval.tests.test_python_macro.test_closed_stdin_still_runs", + "eval.tests.test_python_macro.test_combined_environment_matrix_still_yields_golden", + "eval.tests.test_python_macro.test_combined_new_interpreter_vars_still_golden", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[home_tmp]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[lang_C]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[lang_C_utf8]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonbreakpoint]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonhome_empty]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonhome_usr]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonpath_empty]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonpath_missing]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonpath_tmp]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[pythonuserbase_missing]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[rust_backtrace_1]", + "eval.tests.test_python_macro.test_environment_does_not_break_expansion[rust_backtrace_full]", + "eval.tests.test_python_macro.test_executable_is_present_and_launchable", + "eval.tests.test_python_macro.test_interpolated_rust_variable_value", + "eval.tests.test_python_macro.test_long_truthy_unbuffered_value_flushes_golden", + "eval.tests.test_python_macro.test_panic_carries_python_traceback_filename", + "eval.tests.test_python_macro.test_panic_traceback_precedes_error_frame", + "eval.tests.test_python_macro.test_pipe_closed_by_reader_causes_python_panic", + "eval.tests.test_python_macro.test_pythoncoerce_with_utf8_golden", + "eval.tests.test_python_macro.test_pythondevmode_golden_empty_stderr[dev_mode_1]", + "eval.tests.test_python_macro.test_pythondevmode_golden_empty_stderr[dev_mode_2]", + "eval.tests.test_python_macro.test_pythonfaulthandler_enabled_golden", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[float]", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[hex_literal]", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[negative_one]", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[out_of_range_high]", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[word]", + "eval.tests.test_python_macro.test_pythonhashseed_invalid_seed_fatal_init[word_number]", + "eval.tests.test_python_macro.test_pythonhashseed_valid_values_yield_golden[leading_zeros]", + "eval.tests.test_python_macro.test_pythonhashseed_valid_values_yield_golden[positive]", + "eval.tests.test_python_macro.test_pythonhashseed_valid_values_yield_golden[random_token]", + "eval.tests.test_python_macro.test_pythonhashseed_valid_values_yield_golden[range_max]", + "eval.tests.test_python_macro.test_pythonhashseed_valid_values_yield_golden[zero]", + "eval.tests.test_python_macro.test_pythonhome_existing_empty_dir_fatal", + "eval.tests.test_python_macro.test_pythonhome_pointing_at_a_file_breaks_interpreter_init", + "eval.tests.test_python_macro.test_pythonhome_relative_prefix_breaks_init", + "eval.tests.test_python_macro.test_pythonintmaxstrdigits_golden[python_default_cap]", + "eval.tests.test_python_macro.test_pythonintmaxstrdigits_golden[two_thousand]", + "eval.tests.test_python_macro.test_pythonioencoding_alone_keeps_buffering", + "eval.tests.test_python_macro.test_pythonioencoding_empty_name_uses_default_utf8[backslashreplace]", + "eval.tests.test_python_macro.test_pythonioencoding_empty_name_uses_default_utf8[ignore]", + "eval.tests.test_python_macro.test_pythonioencoding_empty_name_uses_default_utf8[replace]", + "eval.tests.test_python_macro.test_pythonioencoding_empty_name_uses_default_utf8[strict]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[backslashreplace]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[ignore]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[namereplace]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[replace]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[surrogateescape]", + "eval.tests.test_python_macro.test_pythonioencoding_error_handler_variants_golden[xmlcharrefreplace]", + "eval.tests.test_python_macro.test_pythonioencoding_unknown_codec_fatal_init[default]", + "eval.tests.test_python_macro.test_pythonioencoding_unknown_codec_fatal_init[hyphens]", + "eval.tests.test_python_macro.test_pythonioencoding_unknown_codec_fatal_init[long_name]", + "eval.tests.test_python_macro.test_pythonioencoding_unknown_error_handler_kept_utf8", + "eval.tests.test_python_macro.test_pythonioencoding_utf8_sig_prepends_bom", + "eval.tests.test_python_macro.test_pythonmisc_interpreter_switches_golden[coerce_0]", + "eval.tests.test_python_macro.test_pythonmisc_interpreter_switches_golden[coerce_1]", + "eval.tests.test_python_macro.test_pythonmisc_interpreter_switches_golden[platlibdir]", + "eval.tests.test_python_macro.test_pythonmisc_interpreter_switches_golden[stacksize]", + "eval.tests.test_python_macro.test_pythonnodebugranges_switch_golden", + "eval.tests.test_python_macro.test_pythonnonusersite_golden", + "eval.tests.test_python_macro.test_pythonoptimize_switch_golden[no_optimize]", + "eval.tests.test_python_macro.test_pythonoptimize_switch_golden[optimize]", + "eval.tests.test_python_macro.test_pythonprofileimporttime_reports_imports", + "eval.tests.test_python_macro.test_pythonpycacheprefix_devnull_still_runs", + "eval.tests.test_python_macro.test_pythonpycacheprefix_pointing_at_a_file_still_runs", + "eval.tests.test_python_macro.test_pythonpycacheprefix_redirects_bytecode_cache", + "eval.tests.test_python_macro.test_pythonpycacheprefix_with_dontwritebytecode_golden", + "eval.tests.test_python_macro.test_pythonsafepath_switch_golden[disabled]", + "eval.tests.test_python_macro.test_pythonsafepath_switch_golden[enabled]", + "eval.tests.test_python_macro.test_pythonsafepath_with_nousersite_golden", + "eval.tests.test_python_macro.test_pythonstartup_file_not_executed_in_noninteractive_mode", + "eval.tests.test_python_macro.test_pythonstartup_nonexistent_file_not_fatal", + "eval.tests.test_python_macro.test_pythonuserbase_pointing_at_a_file_still_runs", + "eval.tests.test_python_macro.test_pythonuserbase_valid_site_dir_golden", + "eval.tests.test_python_macro.test_pythonuserbase_with_nousersite_golden", + "eval.tests.test_python_macro.test_pythonutf8_switch_golden[disabled]", + "eval.tests.test_python_macro.test_pythonutf8_switch_golden[enabled]", + "eval.tests.test_python_macro.test_pythonutf8_with_ioencoding_golden", + "eval.tests.test_python_macro.test_pythonwarnings_always_warning_cap_policy_golden", + "eval.tests.test_python_macro.test_pythonwarnings_settings_golden[always]", + "eval.tests.test_python_macro.test_pythonwarnings_settings_golden[default]", + "eval.tests.test_python_macro.test_pythonwarnings_settings_golden[error]", + "eval.tests.test_python_macro.test_pythonwarnings_settings_golden[ignore]", + "eval.tests.test_python_macro.test_pythonwarnings_settings_golden[ignore_deprecation]", + "eval.tests.test_python_macro.test_repeated_runs_are_identical", + "eval.tests.test_python_macro.test_runs_from_arbitrary_cwd", + "eval.tests.test_python_macro.test_rust_assert_guard_passes", + "eval.tests.test_python_macro.test_stdin_with_data_is_ignored", + "eval.tests.test_python_macro.test_stdout_redirected_captures_interpolated_line", + "eval.tests.test_python_macro.test_stdout_redirected_to_file_matches_golden", + "eval.tests.test_python_macro.test_stdout_to_devnull_succeeds", + "eval.tests.test_python_macro.test_success_expansion_exact_stdout_bytes", + "eval.tests.test_python_macro.test_success_expansion_golden_stdout", + "eval.tests.test_python_macro.test_success_expansion_no_stderr", + "eval.tests.test_python_macro.test_tty_stdout_line_buffers_without_pythonunbuffered", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[double_zero]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[empty]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[minus_zero]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[plus_zero]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[space_zero]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[tab_zero]", + "eval.tests.test_python_macro.test_unbuffered_falsy_values_keep_buffering[zero]", + "eval.tests.test_python_macro.test_unbuffered_special_truthy_values_flush_golden[float_2_5]", + "eval.tests.test_python_macro.test_unbuffered_special_truthy_values_flush_golden[float_3_14]", + "eval.tests.test_python_macro.test_unbuffered_special_truthy_values_flush_golden[inf_token]", + "eval.tests.test_python_macro.test_unbuffered_special_truthy_values_flush_golden[infinity_token]", + "eval.tests.test_python_macro.test_unbuffered_special_truthy_values_flush_golden[nan_token]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[False_and_tail]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[True]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[capital_False]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[float_zero]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[float_zero_space]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[hex_zero]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[leading_zero_digits]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[lowercase_false]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[minus_one]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[one]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[one_space]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[space_one]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[space_zero_zero]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[true]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[two]", + "eval.tests.test_python_macro.test_unbuffered_truthy_variants_flush_golden[zero_zero_float]", + "eval.tests.test_python_macro.test_unbuffered_with_pythonioencoding_flushes_golden", + "eval.tests.test_python_macro.test_utf16_encoding_unbuffered_writes_non_utf8_bytes", + "eval.tests.test_python_macro.test_valid_pythonhome_yields_golden", + "eval.tests.test_python_macro.test_windows_only_env_vars_noop_on_linux_golden[legacy_fsencoding]", + "eval.tests.test_python_macro.test_windows_only_env_vars_noop_on_linux_golden[legacy_stdio]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_lib_public_api.test_assign_to_context_runs_and_captures_globals", + "eval.tests.test_lib_public_api.test_bare_statement_executes_python", + "eval.tests.test_lib_public_api.test_combined_launch_variations_are_identical", + "eval.tests.test_lib_public_api.test_concurrent_runs_are_isolated_and_identical", + "eval.tests.test_lib_public_api.test_context_reuse_preserves_globals_between_runs", + "eval.tests.test_lib_public_api.test_context_run_executes_block", + "eval.tests.test_lib_public_api.test_each_token_appears_exactly_once", + "eval.tests.test_lib_public_api.test_empty_python_path_env_does_not_alter_piped_output", + "eval.tests.test_lib_public_api.test_exactly_three_output_lines", + "eval.tests.test_lib_public_api.test_executable_is_an_elf_binary_that_runs", + "eval.tests.test_lib_public_api.test_executable_is_elf_binary", + "eval.tests.test_lib_public_api.test_exit_zero_and_no_stderr_when_piped", + "eval.tests.test_lib_public_api.test_exit_zero_with_terminal_output", + "eval.tests.test_lib_public_api.test_falsy_python_unbuffered_values_do_not_flush[0]", + "eval.tests.test_lib_public_api.test_falsy_python_unbuffered_values_do_not_flush[]", + "eval.tests.test_lib_public_api.test_falsy_unbuffered_to_regular_file_loses_output", + "eval.tests.test_lib_public_api.test_full_pty_output_matches_golden", + "eval.tests.test_lib_public_api.test_ignores_command_line_args[args0]", + "eval.tests.test_lib_public_api.test_ignores_command_line_args[args1]", + "eval.tests.test_lib_public_api.test_ignores_command_line_args[args2]", + "eval.tests.test_lib_public_api.test_ignores_command_line_args[args3]", + "eval.tests.test_lib_public_api.test_locale_environment_does_not_change_output[LANG=C]", + "eval.tests.test_lib_public_api.test_locale_environment_does_not_change_output[LANG=en_US.UTF-8]", + "eval.tests.test_lib_public_api.test_locale_environment_does_not_change_output[LC_ALL=C.UTF-8]", + "eval.tests.test_lib_public_api.test_locale_environment_does_not_change_output[LC_ALL=C]", + "eval.tests.test_lib_public_api.test_multiple_inert_python_env_vars_leave_run_unchanged", + "eval.tests.test_lib_public_api.test_no_stray_bytes_after_final_line", + "eval.tests.test_lib_public_api.test_nonzero_wordy_python_unbuffered_values_are_truthy_and_flush[2]", + "eval.tests.test_lib_public_api.test_nonzero_wordy_python_unbuffered_values_are_truthy_and_flush[TRUE]", + "eval.tests.test_lib_public_api.test_nonzero_wordy_python_unbuffered_values_are_truthy_and_flush[false]", + "eval.tests.test_lib_public_api.test_nonzero_wordy_python_unbuffered_values_are_truthy_and_flush[no]", + "eval.tests.test_lib_public_api.test_nonzero_wordy_python_unbuffered_values_are_truthy_and_flush[yes]", + "eval.tests.test_lib_public_api.test_output_has_exact_byte_length", + "eval.tests.test_lib_public_api.test_output_is_clean_utf8", + "eval.tests.test_lib_public_api.test_output_is_exact_concatenation_of_unit_lines", + "eval.tests.test_lib_public_api.test_output_line_order", + "eval.tests.test_lib_public_api.test_output_starts_with_first_line_only", + "eval.tests.test_lib_public_api.test_output_unchanged_when_run_from_other_directory", + "eval.tests.test_lib_public_api.test_output_uses_crlf_line_discipline", + "eval.tests.test_lib_public_api.test_piped_stdout_has_no_python_print_output", + "eval.tests.test_lib_public_api.test_piped_with_closed_stdin_succeeds_and_is_silent", + "eval.tests.test_lib_public_api.test_python_codec_and_dontwritebytecode_env_are_ignored", + "eval.tests.test_lib_public_api.test_python_inspect_env_does_not_alter_piped_output", + "eval.tests.test_lib_public_api.test_python_startup_env_does_not_alter_piped_output", + "eval.tests.test_lib_public_api.test_python_unbuffered_combined_with_codec_env_still_flushes", + "eval.tests.test_lib_public_api.test_python_unbuffered_flushes_prints_into_pipe", + "eval.tests.test_lib_public_api.test_python_unbuffered_flushes_to_regular_file", + "eval.tests.test_lib_public_api.test_python_unbuffered_pty_output_stays_golden", + "eval.tests.test_lib_public_api.test_regular_file_stdout_has_no_python_print_output", + "eval.tests.test_lib_public_api.test_repeated_runs_are_byte_identical", + "eval.tests.test_lib_public_api.test_runs_successfully_with_stdin_closed_and_emits_output", + "eval.tests.test_lib_public_api.test_runs_via_absolute_path", + "eval.tests.test_lib_public_api.test_rust_backtrace_setting_does_not_change_output[0]", + "eval.tests.test_lib_public_api.test_rust_backtrace_setting_does_not_change_output[1]", + "eval.tests.test_lib_public_api.test_rust_variable_interpolation_emits_value", + "eval.tests.test_lib_public_api.test_stdin_is_not_read[5\\n7\\nsome text]", + "eval.tests.test_lib_public_api.test_stdin_is_not_read[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff]", + "eval.tests.test_lib_public_api.test_stdin_is_not_read[]", + "eval.tests.test_lib_public_api.test_stdin_is_not_read[ignored input\\n]", + "eval.tests.test_lib_public_api.test_ten_consecutive_pty_runs_all_match_golden", + "eval.tests.test_lib_public_api.test_terminal_flushes_where_pipe_and_file_do_not", + "eval.tests.test_lib_public_api.test_unbuffered_pipe_and_file_agree_and_differ_from_pty", + "eval.tests.test_lib_public_api.test_unbuffered_pipe_flush_is_deterministic_across_runs", + "eval.tests.test_lib_public_api.test_unbuffered_pipe_output_contains_no_carriage_returns", + "eval.tests.test_lib_public_api.test_unbuffered_pty_with_closed_stdin_still_matches_crlf", + "eval.tests.test_lib_public_api.test_unbuffered_truthy_values_flush_into_regular_file[1]", + "eval.tests.test_lib_public_api.test_unbuffered_truthy_values_flush_into_regular_file[2]", + "eval.tests.test_lib_public_api.test_unbuffered_truthy_values_flush_into_regular_file[TRUE]", + "eval.tests.test_lib_public_api.test_unbuffered_truthy_values_flush_into_regular_file[false]", + "eval.tests.test_lib_public_api.test_unrelated_env_var_is_ignored" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_context.TestCombinedSinkIsolation.test_pty_stdout_with_file_stderr_sink", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_context.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_cpython_env_controls_preserve_golden_contract[extra0]", + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_cpython_env_controls_preserve_golden_contract[extra1]", + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_cpython_env_controls_preserve_golden_contract[extra2]", + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_cpython_env_controls_preserve_golden_contract[extra3]", + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_cpython_env_controls_preserve_golden_contract[extra4]", + "eval.tests.test_context.TestAdditionalCpythonEnvControls.test_unbuffered_pipe_with_no_user_site_and_safe_path", + "eval.tests.test_context.TestBufferingModes.test_block_buffered_pipe_yields_empty_stdout[0]", + "eval.tests.test_context.TestBufferingModes.test_block_buffered_pipe_yields_empty_stdout[None]", + "eval.tests.test_context.TestBufferingModes.test_block_buffered_pipe_yields_empty_stdout[]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[0.0]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[1]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[False]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[NONE]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[TRUE]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[false]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[no]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[off]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[on]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[stdout]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[t]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[true]", + "eval.tests.test_context.TestBufferingModes.test_truthy_unbuffered_yields_golden[yes]", + "eval.tests.test_context.TestCombinedSinkIsolation.test_pty_stdout_with_file_stderr_sink", + "eval.tests.test_context.TestCombinedSinkIsolation.test_two_independent_file_runs_are_byte_identical", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf16_pty_is_nul_interleaved_crlf_without_bom", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf32_file_carries_bom_distinct_from_pipe", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf32_pipe_is_nul_interleaved_without_bom", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf32_pty_is_nul_interleaved_crlf_without_bom", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf8_sig_file_carries_bom_on_file", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf8_sig_pipe_block_buffered_is_empty", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf8_sig_pipe_carries_bom_on_pipe", + "eval.tests.test_context.TestEncodingSinkMatrix.test_utf8_sig_pty_carries_bom_and_crlf", + "eval.tests.test_context.TestEnvironmentDeterminism.test_hostile_home_and_pythonpath_do_not_break_run", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra0]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra1]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra2]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra3]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra4]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra5]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra6]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_perturbing_environment_variables_preserve_golden_contract[extra7]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_hash_seed_does_not_change_stream[0]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_hash_seed_does_not_change_stream[12345]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_hash_seed_does_not_change_stream[1]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_hash_seed_does_not_change_stream[4294967295]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_hash_seed_does_not_change_stream[random]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_io_encoding_preserves_bytes[ascii]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_io_encoding_preserves_bytes[latin-1]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_io_encoding_preserves_bytes[utf-8]", + "eval.tests.test_context.TestEnvironmentDeterminism.test_python_io_encoding_utf16_reencodes_stream", + "eval.tests.test_context.TestEnvironmentDeterminism.test_removing_python_unbuffered_explicitly_yields_empty_pipe", + "eval.tests.test_context.TestExitAndStderr.test_exit_zero_stable_across_repeated_runs_with_semantics", + "eval.tests.test_context.TestExitAndStderr.test_exit_zero_with_golden_stdout", + "eval.tests.test_context.TestExitAndStderr.test_stderr_empty_in_block_buffered_state", + "eval.tests.test_context.TestExitAndStderr.test_stderr_empty_in_unbuffered_state", + "eval.tests.test_context.TestGoldenIntegrity.test_executable_bytes_match_golden_file_bytes", + "eval.tests.test_context.TestGoldenIntegrity.test_executable_emits_golden_exactly", + "eval.tests.test_context.TestGoldenIntegrity.test_golden_file_is_exact_ascii_payload", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args0]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args1]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args2]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args3]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args4]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args5]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_arguments_do_not_change_output[cli_args6]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_combined_args_stdin_and_fresh_cwd_batch", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_cwd_does_not_matter_and_leaves_no_side_files", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_stdin_is_not_read[]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_stdin_is_not_read[exec('evil')\\n]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_stdin_is_not_read[not-python-;;;\\n]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_stdin_is_not_read[print('ignored')\\n]", + "eval.tests.test_context.TestInputSurfaceIsIgnored.test_stdin_is_not_read[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]", + "eval.tests.test_context.TestProfileContract.test_child_receives_complete_parent_environment", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_block_buffered_is_byte_empty", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_empty_string_unbuffered_is_byte_empty", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_leaves_no_stderr_diagnostics", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_unbuffered_contains_exact_golden", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_utf16_block_buffered_is_byte_empty", + "eval.tests.test_context.TestRegularFileStdout.test_file_stdout_utf16_carries_bom_distinct_from_pipe", + "eval.tests.test_context.TestTtyLineBufferedOutput.test_tty_produces_golden_lines_without_unbuffer", + "eval.tests.test_context.TestTtyLineBufferedOutput.test_tty_roundtrips_exact_three_ordered_lines", + "eval.tests.test_context.TestTtyLineBufferedOutput.test_tty_still_respects_truthy_unbuffered_lf", + "eval.tests.test_context.TestUnbufferedStdout.test_arithmetic_get_result_is_final_and_int", + "eval.tests.test_context.TestUnbufferedStdout.test_emits_three_lines_in_causal_order", + "eval.tests.test_context.TestUnbufferedStdout.test_hello_is_first_line", + "eval.tests.test_context.TestUnbufferedStdout.test_raw_bytes_match_golden_without_text_decode", + "eval.tests.test_context.TestUnbufferedStdout.test_stdout_ends_with_single_trailing_newline", + "eval.tests.test_context.TestUnbufferedStdout.test_stored_global_is_read_back_after_hello" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_shared_context.test_context_get_returns_mutated_global", + "eval.tests.test_shared_context.test_globals_persist_across_context_runs" + ] + } + }, + "commit": "635617f217e621a1655adb148800e1f4e1d11243", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5351674851149442, + "eval_clean_hashes": [ + "31585b7c51deedcffc55ef5244a0f86071cbc69c8fa56b6ea55ca99e8797c325" + ], + "input_record": { + "codeql_db_mb": 84.24, + "codeql_status": true, + "codeql_time": 49.154476933181286, + "commit": "635617f217e621a1655adb148800e1f4e1d11243", + "commits": 162, + "contributors": 8, + "difficulty": "easy", + "difficulty_code_lines": 1143, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 1143, + "difficulty_runtime_deps": 2, + "difficulty_score": 1.5351674851149442, + "difficulty_test_code_lines": 104, + "full_name": "m-ou-se/inline-python", + "github_stars": 1250, + "input_codeql_db": "rust_codeql/m-ou-se__inline-python", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "cordx56/rustowl", + "rank": 919, + "similarity": 0.573768138885498 + } + ], + "repo_age": 7.3, + "repo_path": "rust/m-ou-se__inline-python", + "rust_channel": "stable", + "rust_edition": "2024", + "rust_release_date": "2025-06-26", + "rust_version": "1.88.0", + "rust_version_source": "rust-version", + "source": "commit:635617f217e621a1655adb148800e1f4e1d11243", + "status": "done", + "url": "https://github.com/m-ou-se/inline-python" + }, + "instance_id": "m-ou-se__inline-python.635617f", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 5, + "module_kind": "tests", + "termination_reason": "early_stopping" + } + ], + "repository": "m-ou-se/inline-python" +} diff --git a/m-ou-se--inline-python.635617f/tests/test.sh b/m-ou-se--inline-python.635617f/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/m-ou-se--inline-python.635617f/tests/workspace.tar.gz b/m-ou-se--inline-python.635617f/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fb8d933537a7534d5c363e89cfb028eb18e3ec23 --- /dev/null +++ b/m-ou-se--inline-python.635617f/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39f6eefb62f05bf11726d1d70b01d4cef46f67940756b788e12580f3eff2dca4 +size 2267 diff --git a/m1guelpf--auto-commit.66e0c86/environment/Dockerfile b/m1guelpf--auto-commit.66e0c86/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/m1guelpf--auto-commit.66e0c86/environment/download.sh b/m1guelpf--auto-commit.66e0c86/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8c8795d8220063740ba909e1a808dcb8df87f1f --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/environment/download.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# ProgramGym download stage. Source-safe: run via `source /source_ro/download.sh`. +# Prefetches every Cargo dependency the auto-commit offline build needs into the +# shared cargo registry cache ($CARGO_HOME). No compilation/build is performed. +# This file is standalone and never reads repository source files. + +set -e +set -u + +# Guard: this script is sourced, not executed. Never `exit` in normal control flow. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source /source_ro/download.sh" >&2 + exit 1 +fi + +# Build the dependency graph from inline data (mirrors the repository's +# Cargo.toml [dependencies] exactly so the offline build resolves to the same +# crate versions already present in the registry cache). +FETCH_DIR=$(mktemp -d /tmp/auto-commit-fetch.XXXXXX) + +cat > "$FETCH_DIR/Cargo.toml" <<'EOF' +[package] +name = "auto-commit" +version = "0.1.4" +edition = "2021" + +[dependencies] +rand = "0.8.5" +serde = "1.0.164" +spinners = "4.1.0" +question = "0.2.2" +schemars = "0.8.12" +serde_json = "1.0.99" +env_logger = "0.10.0" +clap-verbosity-flag = "2.0.0" +log = { version = "0.4.8", features = ["std"] } +tokio = { version = "1.28.2", features = ["full"] } +clap = { version = "4.0.18", features = ["derive"] } +async-openai = { version = "0.12.0", default-features = false, features = ["native-tls"] } +EOF + +# cargo fetch requires a buildable manifest; provide an empty stub main. +mkdir -p "$FETCH_DIR/src" +printf 'fn main() {}\n' > "$FETCH_DIR/src/main.rs" + +# Run --manifest-path explicitly so cargo never pokes /source_ro or the repo root. +cargo fetch --manifest-path "$FETCH_DIR/Cargo.toml" + +# Clean up only our generated scratch manifest; the downloaded registry cache in +# $CARGO_HOME persists and is what build.sh relies on offline. +rm -rf "$FETCH_DIR" diff --git a/m1guelpf--auto-commit.66e0c86/environment/executable b/m1guelpf--auto-commit.66e0c86/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..fe714dfd58bea5852c53a66397183aa570031056 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56882851f3ee28fbff852d464d8288c89280ce235f0c0f6bdc2084795d1bf57e +size 5965024 diff --git a/m1guelpf--auto-commit.66e0c86/environment/harbor_prepare_download_env.sh b/m1guelpf--auto-commit.66e0c86/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m1guelpf--auto-commit.66e0c86/environment/workspace.tar.gz b/m1guelpf--auto-commit.66e0c86/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..30e94ba28da23c05998fd0a68f9df5aa1464d2a0 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a5f44300b9480ae2705bf7a892bb195c504416176fc1791d04203172a62007 +size 2219 diff --git a/m1guelpf--auto-commit.66e0c86/instruction.md b/m1guelpf--auto-commit.66e0c86/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/m1guelpf--auto-commit.66e0c86/solution/solve.sh b/m1guelpf--auto-commit.66e0c86/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/m1guelpf--auto-commit.66e0c86/task.toml b/m1guelpf--auto-commit.66e0c86/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cc44cc2185a5eedeba67b29e743cf0bc678450e5 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/m1guelpf--auto-commit.66e0c86" +description = "Synthetic ProgramGym cleanroom reconstruction task for m1guelpf/auto-commit" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "m1guelpf__auto-commit.66e0c86" +repository = "m1guelpf/auto-commit" +commit = "66e0c866d3b69f856da36167dc6e5be3781bd643" +language = "rust" +difficulty = "easy" +difficulty_score = 1.5532760461370998 +test_branches = 1 +test_count = 355 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/m1guelpf--auto-commit.66e0c86/tests/Dockerfile b/m1guelpf--auto-commit.66e0c86/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/m1guelpf--auto-commit.66e0c86/tests/blobs/tests/generated_module_01.tar.gz b/m1guelpf--auto-commit.66e0c86/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..afc41a343eea0bf080c37e4fe14e3827a4050d4a --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11e19e617328945f896f8bdcb631dfed953a586a7557c6171c4fd64bc8c2030b +size 25207 diff --git a/m1guelpf--auto-commit.66e0c86/tests/download.sh b/m1guelpf--auto-commit.66e0c86/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8c8795d8220063740ba909e1a808dcb8df87f1f --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/download.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# ProgramGym download stage. Source-safe: run via `source /source_ro/download.sh`. +# Prefetches every Cargo dependency the auto-commit offline build needs into the +# shared cargo registry cache ($CARGO_HOME). No compilation/build is performed. +# This file is standalone and never reads repository source files. + +set -e +set -u + +# Guard: this script is sourced, not executed. Never `exit` in normal control flow. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source /source_ro/download.sh" >&2 + exit 1 +fi + +# Build the dependency graph from inline data (mirrors the repository's +# Cargo.toml [dependencies] exactly so the offline build resolves to the same +# crate versions already present in the registry cache). +FETCH_DIR=$(mktemp -d /tmp/auto-commit-fetch.XXXXXX) + +cat > "$FETCH_DIR/Cargo.toml" <<'EOF' +[package] +name = "auto-commit" +version = "0.1.4" +edition = "2021" + +[dependencies] +rand = "0.8.5" +serde = "1.0.164" +spinners = "4.1.0" +question = "0.2.2" +schemars = "0.8.12" +serde_json = "1.0.99" +env_logger = "0.10.0" +clap-verbosity-flag = "2.0.0" +log = { version = "0.4.8", features = ["std"] } +tokio = { version = "1.28.2", features = ["full"] } +clap = { version = "4.0.18", features = ["derive"] } +async-openai = { version = "0.12.0", default-features = false, features = ["native-tls"] } +EOF + +# cargo fetch requires a buildable manifest; provide an empty stub main. +mkdir -p "$FETCH_DIR/src" +printf 'fn main() {}\n' > "$FETCH_DIR/src/main.rs" + +# Run --manifest-path explicitly so cargo never pokes /source_ro or the repo root. +cargo fetch --manifest-path "$FETCH_DIR/Cargo.toml" + +# Clean up only our generated scratch manifest; the downloaded registry cache in +# $CARGO_HOME persists and is what build.sh relies on offline. +rm -rf "$FETCH_DIR" diff --git a/m1guelpf--auto-commit.66e0c86/tests/executable b/m1guelpf--auto-commit.66e0c86/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..fe714dfd58bea5852c53a66397183aa570031056 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56882851f3ee28fbff852d464d8288c89280ce235f0c0f6bdc2084795d1bf57e +size 5965024 diff --git a/m1guelpf--auto-commit.66e0c86/tests/harbor_prepare_download_env.sh b/m1guelpf--auto-commit.66e0c86/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m1guelpf--auto-commit.66e0c86/tests/programgym_evaluator.py b/m1guelpf--auto-commit.66e0c86/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/m1guelpf--auto-commit.66e0c86/tests/programgym_task.json b/m1guelpf--auto-commit.66e0c86/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..88d7b27bcd66e0cdada628b1661dd65c790878e2 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/programgym_task.json @@ -0,0 +1,917 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_additional.test_dry_run_does_not_bypass_staged_check", + "eval.tests.test_additional.test_dry_run_writes_nothing_to_stdout", + "eval.tests.test_additional.test_flags_do_not_bypass_repo_check[--dry-run]", + "eval.tests.test_additional.test_flags_do_not_bypass_repo_check[--force]", + "eval.tests.test_additional.test_flags_do_not_bypass_repo_check[--review]", + "eval.tests.test_additional.test_flags_do_not_bypass_repo_check[-f]", + "eval.tests.test_additional.test_flags_do_not_bypass_repo_check[-r]", + "eval.tests.test_additional.test_non_dry_run_writes_nothing_to_stdout_before_network", + "eval.tests.test_additional.test_rust_backtrace_panics_show_backtrace", + "eval.tests.test_additional.test_rust_backtrace_unset_panics_have_no_backtrace", + "eval.tests.test_additional.test_rust_log_does_not_force_info_when_quiet", + "eval.tests.test_additional.test_rust_log_does_not_override_verbosity", + "eval.tests.test_additional.test_rust_log_warn_keeps_error_at_verbose", + "eval.tests.test_additional.test_unusual_keys_still_pass_the_key_gate[ leading-and-trailing-space ]", + "eval.tests.test_additional.test_unusual_keys_still_pass_the_key_gate[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "eval.tests.test_additional.test_unusual_keys_still_pass_the_key_gate[key-with\\nnewline]", + "eval.tests.test_additional.test_unusual_keys_still_pass_the_key_gate[sk-1234567890-abcdef-ABCDEF]", + "eval.tests.test_additional.test_unusual_keys_still_pass_the_key_gate[sk-special-=_!@#$%^&*()]", + "eval.tests.test_additional.test_whitespace_only_keys_passed_but_still_reach_repo_gate[ ]", + "eval.tests.test_additional.test_whitespace_only_keys_passed_but_still_reach_repo_gate[\\n]", + "eval.tests.test_additional.test_whitespace_only_keys_passed_but_still_reach_repo_gate[\\t]", + "eval.tests.test_additional.test_whitespace_only_keys_passed_but_still_reach_repo_gate[]", + "eval.tests.test_api_key.test_blank_key_is_treated_as_set[ ]", + "eval.tests.test_api_key.test_blank_key_is_treated_as_set[\\t]", + "eval.tests.test_api_key.test_blank_key_is_treated_as_set[]", + "eval.tests.test_api_key.test_blank_key_proceeds_past_key_check_to_git", + "eval.tests.test_api_key.test_missing_key_error_goes_to_stderr", + "eval.tests.test_api_key.test_set_key_reaches_git_check", + "eval.tests.test_api_key.test_set_key_with_missing_git_reaches_staged_diff", + "eval.tests.test_api_key.test_unset_key_exits_before_git", + "eval.tests.test_api_key.test_unset_key_prints_error_and_exits_1", + "eval.tests.test_api_key.test_unset_key_still_required_with_other_flags[--dry-run]", + "eval.tests.test_api_key.test_unset_key_still_required_with_other_flags[--force]", + "eval.tests.test_api_key.test_unset_key_still_required_with_other_flags[--review]", + "eval.tests.test_api_key.test_unset_key_still_required_with_other_flags[-f]", + "eval.tests.test_api_key.test_unset_key_still_required_with_other_flags[-r]", + "eval.tests.test_cli_args.test_bare_double_dash_is_accepted", + "eval.tests.test_cli_args.test_case_variant_with_similar_argument_tip[pair0]", + "eval.tests.test_cli_args.test_case_variant_with_similar_argument_tip[pair1]", + "eval.tests.test_cli_args.test_double_dash_makes_positional[pair0]", + "eval.tests.test_cli_args.test_double_dash_makes_positional[pair1]", + "eval.tests.test_cli_args.test_double_dash_makes_positional[pair2]", + "eval.tests.test_cli_args.test_empty_string_positional_rejected", + "eval.tests.test_cli_args.test_error_block_goes_to_stderr_only", + "eval.tests.test_cli_args.test_error_trailer_present_for_value_conflict", + "eval.tests.test_cli_args.test_flag_followed_by_a_value_is_rejected[pair0]", + "eval.tests.test_cli_args.test_flag_followed_by_a_value_is_rejected[pair1]", + "eval.tests.test_cli_args.test_flag_followed_by_a_value_is_rejected[pair2]", + "eval.tests.test_cli_args.test_flags_are_case_sensitive[pair0]", + "eval.tests.test_cli_args.test_flags_are_case_sensitive[pair1]", + "eval.tests.test_cli_args.test_long_flag_value_assignment_rejected[pair0]", + "eval.tests.test_cli_args.test_long_flag_value_assignment_rejected[pair1]", + "eval.tests.test_cli_args.test_long_flag_value_assignment_rejected[pair2]", + "eval.tests.test_cli_args.test_mix_unknown_with_known_rejected", + "eval.tests.test_cli_args.test_positional_not_expected[1-error_positional_one.txt]", + "eval.tests.test_cli_args.test_positional_not_expected[foo-error_positional_foo.txt]", + "eval.tests.test_cli_args.test_positional_not_expected[hello-world-error_positional_hello.txt]", + "eval.tests.test_cli_args.test_positional_not_expected[staging-error_positional_staging.txt]", + "eval.tests.test_cli_args.test_positional_not_expected[x-error_positional_x.txt]", + "eval.tests.test_cli_args.test_repeated_shorts_in_cluster[-ff-error_repeat_force.txt]", + "eval.tests.test_cli_args.test_repeated_shorts_in_cluster[-rr-error_repeat_review.txt]", + "eval.tests.test_cli_args.test_repeating_a_flag_pair[--dry-run-error_repeat_dryrun.txt]", + "eval.tests.test_cli_args.test_repeating_a_flag_pair[--force-error_repeat_force.txt]", + "eval.tests.test_cli_args.test_repeating_a_flag_pair[--review-error_repeat_review.txt]", + "eval.tests.test_cli_args.test_repeating_a_flag_pair[-f-error_repeat_force.txt]", + "eval.tests.test_cli_args.test_repeating_a_flag_pair[-r-error_repeat_review.txt]", + "eval.tests.test_cli_args.test_unknown_long_flag_rejected_exact[pair0]", + "eval.tests.test_cli_args.test_unknown_long_flag_rejected_exact[pair1]", + "eval.tests.test_cli_args.test_unknown_long_flag_rejected_exact[pair2]", + "eval.tests.test_cli_args.test_unknown_short_flag_rejected_exact[pair0]", + "eval.tests.test_cli_args.test_unknown_short_flag_rejected_exact[pair1]", + "eval.tests.test_cli_args.test_unknown_short_flag_rejected_exact[pair2]", + "eval.tests.test_edge_cases.test_blank_key_ignores_trimmed_emptiness[ \\t ]", + "eval.tests.test_edge_cases.test_blank_key_ignores_trimmed_emptiness[\\n ]", + "eval.tests.test_edge_cases.test_blank_key_ignores_trimmed_emptiness[]", + "eval.tests.test_edge_cases.test_double_dash_positional_boundaries[combo0]", + "eval.tests.test_edge_cases.test_double_dash_positional_boundaries[combo1]", + "eval.tests.test_edge_cases.test_double_dash_positional_boundaries[combo2]", + "eval.tests.test_edge_cases.test_double_dash_positional_boundaries[combo3]", + "eval.tests.test_edge_cases.test_dry_run_verbose_ignores_rust_log_off", + "eval.tests.test_edge_cases.test_full_silence_trumps_rust_log_trace", + "eval.tests.test_edge_cases.test_git_missing_panic_ignores_verbosity[verbosity0]", + "eval.tests.test_edge_cases.test_git_missing_panic_ignores_verbosity[verbosity1]", + "eval.tests.test_edge_cases.test_git_missing_panic_ignores_verbosity[verbosity2]", + "eval.tests.test_edge_cases.test_git_missing_panic_ignores_verbosity[verbosity3]", + "eval.tests.test_edge_cases.test_git_missing_panic_not_swallowed_by_quiet_flag", + "eval.tests.test_edge_cases.test_git_missing_panic_stdout_stays_empty", + "eval.tests.test_edge_cases.test_git_missing_requires_key_first", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[0]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[N/A]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[false]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[none]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[null]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[true]", + "eval.tests.test_edge_cases.test_key_value_truthiness_irrelevant[undefined]", + "eval.tests.test_edge_cases.test_malformed_flag_spellings_rejected_exact[--dry-run=1-error_value_dry_run_1.txt]", + "eval.tests.test_edge_cases.test_malformed_flag_spellings_rejected_exact[--force=false-error_value_force_false.txt]", + "eval.tests.test_edge_cases.test_mode_flag_not_silent_in_not_repo_shows_error[verbosity0]", + "eval.tests.test_edge_cases.test_mode_flag_not_silent_in_not_repo_shows_error[verbosity1]", + "eval.tests.test_edge_cases.test_mode_flag_not_silent_in_not_repo_shows_error[verbosity2]", + "eval.tests.test_edge_cases.test_mode_flag_not_silent_in_not_repo_shows_error[verbosity3]", + "eval.tests.test_edge_cases.test_mode_flag_silent_in_not_repo_is_silent[args0]", + "eval.tests.test_edge_cases.test_mode_flag_silent_in_not_repo_is_silent[args1]", + "eval.tests.test_edge_cases.test_mode_flag_silent_in_not_repo_is_silent[args2]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args0]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args1]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args2]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args3]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args4]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args5]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args6]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args7]", + "eval.tests.test_edge_cases.test_mode_flag_with_full_silence_hides_key_error[args8]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args0]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args1]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args2]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args3]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args4]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args5]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args6]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args7]", + "eval.tests.test_edge_cases.test_mode_flag_with_verbose_shows_key_error[args8]", + "eval.tests.test_edge_cases.test_unknown_and_duplicate_short_clusters_exact[-dd]", + "eval.tests.test_edge_cases.test_unknown_and_duplicate_short_clusters_exact[-fff]", + "eval.tests.test_edge_cases.test_unknown_and_duplicate_short_clusters_exact[-rfdd]", + "eval.tests.test_edge_cases.test_unknown_and_duplicate_short_clusters_exact[-rrf]", + "eval.tests.test_edge_cases.test_valid_repo_blocks_at_diff_head_on_default", + "eval.tests.test_edge_cases.test_whitespace_only_staged_not_empty[ \\n \\n]", + "eval.tests.test_edge_cases.test_whitespace_only_staged_not_empty[ ]", + "eval.tests.test_edge_cases.test_whitespace_only_staged_not_empty[ \\n]", + "eval.tests.test_edge_cases.test_whitespace_only_staged_not_empty[\\r\\r]", + "eval.tests.test_edge_cases.test_whitespace_only_staged_not_empty[\\t\\t\\n]", + "eval.tests.test_edge_cases.test_zero_bytes_staged_trigger_warning_then_not_repo", + "eval.tests.test_flag_combos.test_double_dash_forces_positional_parse", + "eval.tests.test_flag_combos.test_double_dash_then_foo_positional_rejected", + "eval.tests.test_flag_combos.test_each_mode_flag_reaches_key_gate[--dry-run]", + "eval.tests.test_flag_combos.test_each_mode_flag_reaches_key_gate[--force]", + "eval.tests.test_flag_combos.test_each_mode_flag_reaches_key_gate[--review]", + "eval.tests.test_flag_combos.test_force_then_equals_value_rejected", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair0]", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair1]", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair2]", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair3]", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair4]", + "eval.tests.test_flag_combos.test_repeating_a_flag_is_rejected[pair5]", + "eval.tests.test_flag_combos.test_review_then_value_rejected", + "eval.tests.test_flag_combos.test_review_with_force_and_dryrun_combined_exact", + "eval.tests.test_flag_combos.test_unknown_flag_in_valid_combo_rejected", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo0]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo10]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo11]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo12]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo13]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo14]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo1]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo2]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo3]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo4]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo5]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo6]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo7]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo8]", + "eval.tests.test_flag_combos.test_valid_flag_combos_reach_key_gate[combo9]", + "eval.tests.test_flag_combos.test_value_following_valid_flag_rejected", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair0]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair1]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair2]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair3]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair4]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_quiet_first[pair5]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair0]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair1]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair2]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair3]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair4]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair5]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair6]", + "eval.tests.test_flag_combos.test_verbose_quiet_conflict_verbose_first[pair7]", + "eval.tests.test_flag_combos.test_verbosity_count_flags_may_be_repeated", + "eval.tests.test_git_validation.test_commit_never_spawned_outside_repo", + "eval.tests.test_git_validation.test_dry_run_skips_loading_data_preamble", + "eval.tests.test_git_validation.test_empty_staged_and_not_repo_report_both", + "eval.tests.test_git_validation.test_empty_staged_message_variant", + "eval.tests.test_git_validation.test_empty_staged_with_valid_repo_logs_but_proceeds", + "eval.tests.test_git_validation.test_missing_git_binary_panics", + "eval.tests.test_git_validation.test_missing_git_requires_key_first", + "eval.tests.test_git_validation.test_non_dry_run_loads_data_before_network", + "eval.tests.test_git_validation.test_non_empty_staged_prints_no_staged_warning", + "eval.tests.test_git_validation.test_not_inside_work_tree_is_fatal[0\\n]", + "eval.tests.test_git_validation.test_not_inside_work_tree_is_fatal[false\\n]", + "eval.tests.test_git_validation.test_not_inside_work_tree_is_fatal[false]", + "eval.tests.test_git_validation.test_not_inside_work_tree_is_fatal[garbage-not-a-boolean\\n]", + "eval.tests.test_git_validation.test_not_inside_work_tree_is_fatal[no\\n]", + "eval.tests.test_git_validation.test_not_repo_error_goes_to_stderr", + "eval.tests.test_git_validation.test_not_repo_exits_before_network", + "eval.tests.test_git_validation.test_not_repo_fatal_in_every_flag_mode[--dry-run]", + "eval.tests.test_git_validation.test_not_repo_fatal_in_every_flag_mode[-f]", + "eval.tests.test_git_validation.test_not_repo_fatal_in_every_flag_mode[-q]", + "eval.tests.test_git_validation.test_not_repo_fatal_in_every_flag_mode[-r]", + "eval.tests.test_git_validation.test_not_repo_fatal_in_every_flag_mode[-v]", + "eval.tests.test_git_validation.test_single_char_staged_is_not_empty[ ]", + "eval.tests.test_git_validation.test_single_char_staged_is_not_empty[0]", + "eval.tests.test_git_validation.test_single_char_staged_is_not_empty[\\n]", + "eval.tests.test_git_validation.test_single_char_staged_is_not_empty[\\r\\n]", + "eval.tests.test_git_validation.test_single_char_staged_is_not_empty[\\r]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[ true\\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[\\ttrue\\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true \\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true \\t\\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true\\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true\\r\\n\\t]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true\\r\\n]", + "eval.tests.test_git_validation.test_work_tree_true_variants_pass_repo_gate[true]", + "eval.tests.test_git_validation.test_zero_byte_staged_is_empty", + "eval.tests.test_help_version.test_help_after_mode_flags_exact", + "eval.tests.test_help_version.test_help_after_valid_flags_still_helps", + "eval.tests.test_help_version.test_help_does_not_touch_network_or_git", + "eval.tests.test_help_version.test_help_dry_run_describes_behavior", + "eval.tests.test_help_version.test_help_exits_zero_and_matches_golden[--help]", + "eval.tests.test_help_version.test_help_exits_zero_and_matches_golden[-h]", + "eval.tests.test_help_version.test_help_force_describes_behavior", + "eval.tests.test_help_version.test_help_goes_to_stdout_not_stderr", + "eval.tests.test_help_version.test_help_lists_every_option[--help]", + "eval.tests.test_help_version.test_help_lists_every_option[-h]", + "eval.tests.test_help_version.test_help_option_block_is_stable", + "eval.tests.test_help_version.test_help_precedence_when_first[order0]", + "eval.tests.test_help_version.test_help_precedence_when_first[order1]", + "eval.tests.test_help_version.test_help_precedence_when_first[order2]", + "eval.tests.test_help_version.test_help_review_describes_behavior", + "eval.tests.test_help_version.test_help_verbose_quiet_lines_present", + "eval.tests.test_help_version.test_short_help_ignores_missing_key", + "eval.tests.test_help_version.test_short_help_matches_long_help", + "eval.tests.test_help_version.test_version_goes_to_stdout", + "eval.tests.test_help_version.test_version_precedence_when_first[order0]", + "eval.tests.test_help_version.test_version_precedence_when_first[order1]", + "eval.tests.test_help_version.test_version_precedence_when_first[order2]", + "eval.tests.test_help_version.test_version_prints_name_and_semver[--version]", + "eval.tests.test_help_version.test_version_prints_name_and_semver[-V]", + "eval.tests.test_help_version.test_version_shortcircuits_trailing_args", + "eval.tests.test_short_groups.test_dash_interleaved_short_group_rejected[-q-v]", + "eval.tests.test_short_groups.test_dash_interleaved_short_group_rejected[-v-q]", + "eval.tests.test_short_groups.test_help_and_verbose_combined", + "eval.tests.test_short_groups.test_help_does_not_run_git", + "eval.tests.test_short_groups.test_help_flag_with_short_help", + "eval.tests.test_short_groups.test_help_ignores_git_and_env", + "eval.tests.test_short_groups.test_help_wins_over_dry_run", + "eval.tests.test_short_groups.test_help_wins_over_review", + "eval.tests.test_short_groups.test_parse_of_known_forms_ok[--dry-run]", + "eval.tests.test_short_groups.test_parse_of_known_forms_ok[-f]", + "eval.tests.test_short_groups.test_parse_of_known_forms_ok[-q]", + "eval.tests.test_short_groups.test_parse_of_known_forms_ok[-r]", + "eval.tests.test_short_groups.test_parse_of_known_forms_ok[-v]", + "eval.tests.test_short_groups.test_short_flag_equals_value_rejected[-f=1]", + "eval.tests.test_short_groups.test_short_flag_equals_value_rejected[-r=yes]", + "eval.tests.test_short_groups.test_short_flag_equals_value_rejected[-v=2]", + "eval.tests.test_short_groups.test_short_groups_mixing_verbose_and_quiet_rejected[-qqv]", + "eval.tests.test_short_groups.test_short_groups_mixing_verbose_and_quiet_rejected[-vvq]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-fr0]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-fr1]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-frq]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-rf]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-rfq0]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-rfq1]", + "eval.tests.test_short_groups.test_short_groups_of_boolean_flags_parse[-rfv]", + "eval.tests.test_short_groups.test_short_help_equals_long_help", + "eval.tests.test_short_groups.test_version_first_wins_over_flags", + "eval.tests.test_short_groups.test_version_with_mode_flags_exact", + "eval.tests.test_spinner.test_dry_run_silent_uses_the_none_branch[verbose_args0]", + "eval.tests.test_spinner.test_dry_run_silent_uses_the_none_branch[verbose_args1]", + "eval.tests.test_spinner.test_dry_run_silent_uses_the_none_branch[verbose_args2]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode0-verbose_args0]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode0-verbose_args1]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode0-verbose_args2]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode1-verbose_args0]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode1-verbose_args1]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode1-verbose_args2]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode2-verbose_args0]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode2-verbose_args1]", + "eval.tests.test_spinner.test_every_silent_mode_cross_product_spins[mode2-verbose_args2]", + "eval.tests.test_spinner.test_hanging_diff_head_reaches_no_spinner", + "eval.tests.test_spinner.test_non_dry_run_emits_loading_data_info[verbose_args0]", + "eval.tests.test_spinner.test_non_dry_run_emits_loading_data_info[verbose_args1]", + "eval.tests.test_spinner.test_non_dry_run_emits_loading_data_info[verbose_args2]", + "eval.tests.test_spinner.test_non_dry_run_emits_loading_data_info[verbose_args3]", + "eval.tests.test_spinner.test_non_silent_verbosity_does_not_spin[verbose_args0]", + "eval.tests.test_spinner.test_non_silent_verbosity_does_not_spin[verbose_args1]", + "eval.tests.test_spinner.test_non_silent_verbosity_does_not_spin[verbose_args2]", + "eval.tests.test_spinner.test_non_silent_verbosity_does_not_spin[verbose_args3]", + "eval.tests.test_spinner.test_non_silent_verbosity_does_not_spin[verbose_args4]", + "eval.tests.test_spinner.test_silent_short_clusters_emit_spinner[flags0]", + "eval.tests.test_spinner.test_silent_short_clusters_emit_spinner[flags1]", + "eval.tests.test_spinner.test_silent_short_clusters_emit_spinner[flags2]", + "eval.tests.test_spinner.test_silent_short_clusters_emit_spinner[flags3]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args0]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args1]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args2]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args3]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args4]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args5]", + "eval.tests.test_spinner.test_silent_verbosity_emits_analyzing_spinner[verbose_args6]", + "eval.tests.test_spinner.test_silent_verbosity_with_mode_flag_still_spins[mode0]", + "eval.tests.test_spinner.test_silent_verbosity_with_mode_flag_still_spins[mode1]", + "eval.tests.test_spinner.test_silent_verbosity_with_mode_flag_still_spins[mode2]", + "eval.tests.test_spinner.test_silent_verbosity_with_mode_flag_still_spins[mode3]", + "eval.tests.test_spinner.test_silent_verbosity_with_mode_flag_still_spins[mode4]", + "eval.tests.test_utf8_panics.test_invalid_utf8_diffhead_panic_names_line_111", + "eval.tests.test_utf8_panics.test_invalid_utf8_git_output_panics[diffhead]", + "eval.tests.test_utf8_panics.test_invalid_utf8_git_output_panics[revparse]", + "eval.tests.test_utf8_panics.test_invalid_utf8_git_output_panics[staged]", + "eval.tests.test_utf8_panics.test_invalid_utf8_revparse_panic_names_line_98", + "eval.tests.test_utf8_panics.test_invalid_utf8_staged_panic_names_line_85", + "eval.tests.test_utf8_panics.test_utf8_panic_backtrace_when_enabled[diffhead]", + "eval.tests.test_utf8_panics.test_utf8_panic_backtrace_when_enabled[revparse]", + "eval.tests.test_utf8_panics.test_utf8_panic_backtrace_when_enabled[staged]", + "eval.tests.test_utf8_panics.test_utf8_panic_goes_to_stderr_not_stdout", + "eval.tests.test_utf8_panics.test_utf8_panic_ignores_verbosity_silence[diffhead]", + "eval.tests.test_utf8_panics.test_utf8_panic_ignores_verbosity_silence[revparse]", + "eval.tests.test_utf8_panics.test_utf8_panic_ignores_verbosity_silence[staged]", + "eval.tests.test_utf8_panics.test_utf8_panic_no_backtrace_by_default[diffhead]", + "eval.tests.test_utf8_panics.test_utf8_panic_no_backtrace_by_default[revparse]", + "eval.tests.test_utf8_panics.test_utf8_panic_no_backtrace_by_default[staged]", + "eval.tests.test_utf8_panics.test_utf8_panic_requires_key_first[diffhead]", + "eval.tests.test_utf8_panics.test_utf8_panic_requires_key_first[revparse]", + "eval.tests.test_utf8_panics.test_utf8_panic_requires_key_first[staged]", + "eval.tests.test_utf8_panics.test_valid_utf8_staged_diff_does_not_panic", + "eval.tests.test_verbosity.test_info_loading_data_on_stdout_never", + "eval.tests.test_verbosity.test_info_loading_data_shown_at_default", + "eval.tests.test_verbosity.test_info_loading_data_suppressed_by_qq", + "eval.tests.test_verbosity.test_info_loading_data_suppressed_by_quiet", + "eval.tests.test_verbosity.test_missing_key_error_full_trace_still_hidden_at_silence", + "eval.tests.test_verbosity.test_missing_key_error_hidden_when_silent[verbosity0]", + "eval.tests.test_verbosity.test_missing_key_error_hidden_when_silent[verbosity1]", + "eval.tests.test_verbosity.test_missing_key_error_hidden_when_silent[verbosity2]", + "eval.tests.test_verbosity.test_missing_key_error_hidden_when_silent[verbosity3]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity0]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity1]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity2]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity3]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity4]", + "eval.tests.test_verbosity.test_missing_key_error_visible_below_silence[verbosity5]", + "eval.tests.test_verbosity.test_not_repo_error_hidden_when_silent[verbosity0]", + "eval.tests.test_verbosity.test_not_repo_error_hidden_when_silent[verbosity1]", + "eval.tests.test_verbosity.test_not_repo_error_hidden_when_silent[verbosity2]", + "eval.tests.test_verbosity.test_not_repo_error_visible_below_silence[verbosity0]", + "eval.tests.test_verbosity.test_not_repo_error_visible_below_silence[verbosity1]", + "eval.tests.test_verbosity.test_not_repo_error_visible_below_silence[verbosity2]", + "eval.tests.test_verbosity.test_not_repo_error_visible_below_silence[verbosity3]", + "eval.tests.test_verbosity.test_not_repo_error_visible_below_silence[verbosity4]", + "eval.tests.test_verbosity.test_not_repo_exit_code_and_message_independent_of_verbosity[verbosity0]", + "eval.tests.test_verbosity.test_not_repo_exit_code_and_message_independent_of_verbosity[verbosity1]", + "eval.tests.test_verbosity.test_not_repo_exit_code_and_message_independent_of_verbosity[verbosity2]", + "eval.tests.test_verbosity.test_not_repo_exit_code_and_message_independent_of_verbosity[verbosity3]", + "eval.tests.test_verbosity.test_silent_verbosity_passes_pre_network_gates", + "eval.tests.test_verbosity.test_verbose_and_trace_still_show_info[verbosity0]", + "eval.tests.test_verbosity.test_verbose_and_trace_still_show_info[verbosity1]" + ] + } + }, + "commit": "66e0c866d3b69f856da36167dc6e5be3781bd643", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5532760461370998, + "eval_clean_hashes": [ + "56882851f3ee28fbff852d464d8288c89280ce235f0c0f6bdc2084795d1bf57e" + ], + "input_record": { + "codeql_db_mb": 83.27, + "codeql_status": true, + "codeql_time": 76.7093431209214, + "commit": "66e0c866d3b69f856da36167dc6e5be3781bd643", + "commits": 19, + "contributors": 5, + "difficulty": "easy", + "difficulty_code_lines": 275, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 275, + "difficulty_runtime_deps": 12, + "difficulty_score": 1.5532760461370998, + "difficulty_test_code_lines": 0, + "full_name": "m1guelpf/auto-commit", + "github_stars": 1222, + "input_codeql_db": "rust_codeql/m1guelpf__auto-commit", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "BurntSushi/xsv", + "rank": 255, + "similarity": 0.5143811106681824 + }, + { + "pb_fullname": "ducaale/xh", + "rank": 109, + "similarity": 0.546290934085846 + }, + { + "pb_fullname": "AmmarAbouZor/tui-journal", + "rank": 101, + "similarity": 0.5563238859176636 + }, + { + "pb_fullname": "pemistahl/grex", + "rank": 135, + "similarity": 0.5183413028717041 + }, + { + "pb_fullname": "Miserlou/Loop", + "rank": 80, + "similarity": 0.5222006440162659 + }, + { + "pb_fullname": "Drew-Alleman/DataSurgeon", + "rank": 140, + "similarity": 0.5481953024864197 + }, + { + "pb_fullname": "BurntSushi/ripgrep", + "rank": 95, + "similarity": 0.49279022216796875 + }, + { + "pb_fullname": "nachoparker/dutree", + "rank": 106, + "similarity": 0.5448763370513916 + }, + { + "pb_fullname": "Canop/rhit", + "rank": 248, + "similarity": 0.4690399765968323 + }, + { + "pb_fullname": "sharkdp/hexyl", + "rank": 272, + "similarity": 0.4753466844558716 + }, + { + "pb_fullname": "altdesktop/i3-style", + "rank": 130, + "similarity": 0.5084909200668335 + }, + { + "pb_fullname": "brocode/fblog", + "rank": 83, + "similarity": 0.5253960490226746 + }, + { + "pb_fullname": "svenstaro/miniserve", + "rank": 597, + "similarity": 0.49166440963745117 + }, + { + "pb_fullname": "sayanarijit/xplr", + "rank": 452, + "similarity": 0.5377951860427856 + }, + { + "pb_fullname": "alexpovel/srgn", + "rank": 92, + "similarity": 0.5679589509963989 + }, + { + "pb_fullname": "svenstaro/genact", + "rank": 900, + "similarity": 0.5098754167556763 + }, + { + "pb_fullname": "git-bahn/git-graph", + "rank": 15, + "similarity": 0.6489068865776062 + }, + { + "pb_fullname": "Stranger6667/jsonschema", + "rank": 390, + "similarity": 0.39576083421707153 + }, + { + "pb_fullname": "rvben/rumdl", + "rank": 19, + "similarity": 0.6384940147399902 + }, + { + "pb_fullname": "dandavison/delta", + "rank": 13, + "similarity": 0.6519500017166138 + }, + { + "pb_fullname": "bootandy/dust", + "rank": 200, + "similarity": 0.5277407765388489 + }, + { + "pb_fullname": "sharkdp/hyperfine", + "rank": 138, + "similarity": 0.5175329446792603 + }, + { + "pb_fullname": "jhspetersson/fselect", + "rank": 244, + "similarity": 0.48750853538513184 + }, + { + "pb_fullname": "rust-lang/mdBook", + "rank": 73, + "similarity": 0.5458636283874512 + }, + { + "pb_fullname": "kaushiksrini/parqeye", + "rank": 602, + "similarity": 0.46159452199935913 + }, + { + "pb_fullname": "dalance/amber", + "rank": 84, + "similarity": 0.557542085647583 + }, + { + "pb_fullname": "ajeetdsouza/zoxide", + "rank": 142, + "similarity": 0.5550127625465393 + }, + { + "pb_fullname": "orf/gping", + "rank": 806, + "similarity": 0.4462563395500183 + }, + { + "pb_fullname": "stacked-git/stgit", + "rank": 5, + "similarity": 0.6933510303497314 + }, + { + "pb_fullname": "rust-ethereum/ethabi", + "rank": 447, + "similarity": 0.5048822164535522 + }, + { + "pb_fullname": "blacknon/hwatch", + "rank": 53, + "similarity": 0.6314538717269897 + }, + { + "pb_fullname": "foriequal0/git-trim", + "rank": 33, + "similarity": 0.5536883473396301 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 38, + "similarity": 0.6060317754745483 + }, + { + "pb_fullname": "sstadick/hck", + "rank": 109, + "similarity": 0.494834303855896 + }, + { + "pb_fullname": "paradigmxyz/solar", + "rank": 333, + "similarity": 0.49872735142707825 + }, + { + "pb_fullname": "bensadeh/tailspin", + "rank": 59, + "similarity": 0.561478853225708 + }, + { + "pb_fullname": "oppiliappan/eva", + "rank": 180, + "similarity": 0.5271064043045044 + }, + { + "pb_fullname": "tarka/xcp", + "rank": 126, + "similarity": 0.5050070285797119 + }, + { + "pb_fullname": "WGUNDERWOOD/tex-fmt", + "rank": 76, + "similarity": 0.5427603721618652 + }, + { + "pb_fullname": "axodotdev/oranda", + "rank": 97, + "similarity": 0.5630560517311096 + }, + { + "pb_fullname": "Lymphatus/caesium-clt", + "rank": 135, + "similarity": 0.514649510383606 + }, + { + "pb_fullname": "cordx56/rustowl", + "rank": 842, + "similarity": 0.5787664651870728 + }, + { + "pb_fullname": "Isona/dirble", + "rank": 536, + "similarity": 0.4669567346572876 + }, + { + "pb_fullname": "o2sh/onefetch", + "rank": 13, + "similarity": 0.652219295501709 + }, + { + "pb_fullname": "sitkevij/hex", + "rank": 148, + "similarity": 0.5263946056365967 + }, + { + "pb_fullname": "codesnap-rs/codesnap", + "rank": 26, + "similarity": 0.6689666509628296 + }, + { + "pb_fullname": "ismaelgv/rnr", + "rank": 66, + "similarity": 0.4937279224395752 + }, + { + "pb_fullname": "nuta/nsh", + "rank": 132, + "similarity": 0.5806161165237427 + }, + { + "pb_fullname": "sirwart/ripsecrets", + "rank": 14, + "similarity": 0.6388051509857178 + }, + { + "pb_fullname": "sharkdp/pastel", + "rank": 58, + "similarity": 0.5391860008239746 + }, + { + "pb_fullname": "astro/deadnix", + "rank": 83, + "similarity": 0.5628625154495239 + }, + { + "pb_fullname": "wfxr/code-minimap", + "rank": 64, + "similarity": 0.6114678978919983 + }, + { + "pb_fullname": "eudoxia0/hashcards", + "rank": 54, + "similarity": 0.5929217338562012 + }, + { + "pb_fullname": "riquito/tuc", + "rank": 82, + "similarity": 0.4987121820449829 + }, + { + "pb_fullname": "Nukesor/pueue", + "rank": 434, + "similarity": 0.46341270208358765 + }, + { + "pb_fullname": "crowdagger/crowbook", + "rank": 105, + "similarity": 0.49384552240371704 + }, + { + "pb_fullname": "simeg/eureka", + "rank": 1, + "similarity": 0.72463059425354 + }, + { + "pb_fullname": "Esubaalew/run", + "rank": 146, + "similarity": 0.5980645418167114 + }, + { + "pb_fullname": "clog-tool/clog-cli", + "rank": 3, + "similarity": 0.7268528938293457 + }, + { + "pb_fullname": "rhysd/kiro-editor", + "rank": 82, + "similarity": 0.6186071634292603 + }, + { + "pb_fullname": "sigoden/argc", + "rank": 40, + "similarity": 0.5696716904640198 + }, + { + "pb_fullname": "ast-grep/ast-grep", + "rank": 69, + "similarity": 0.6111335754394531 + }, + { + "pb_fullname": "unhappychoice/gittype", + "rank": 34, + "similarity": 0.6497014164924622 + }, + { + "pb_fullname": "hush-shell/hush", + "rank": 426, + "similarity": 0.47631630301475525 + }, + { + "pb_fullname": "chmln/sd", + "rank": 79, + "similarity": 0.5490459203720093 + }, + { + "pb_fullname": "rcoh/angle-grinder", + "rank": 288, + "similarity": 0.5076990127563477 + }, + { + "pb_fullname": "kyoheiu/felix", + "rank": 254, + "similarity": 0.5656211376190186 + }, + { + "pb_fullname": "Epistates/treemd", + "rank": 147, + "similarity": 0.5992546081542969 + }, + { + "pb_fullname": "typst/typst", + "rank": 296, + "similarity": 0.48807018995285034 + }, + { + "pb_fullname": "chmln/handlr", + "rank": 277, + "similarity": 0.5184617042541504 + }, + { + "pb_fullname": "rbakbashev/elfcat", + "rank": 683, + "similarity": 0.4750814735889435 + }, + { + "pb_fullname": "elkowar/pipr", + "rank": 78, + "similarity": 0.6464297771453857 + }, + { + "pb_fullname": "mgdm/htmlq", + "rank": 248, + "similarity": 0.482942670583725 + }, + { + "pb_fullname": "nikolassv/bartib", + "rank": 41, + "similarity": 0.5393671989440918 + }, + { + "pb_fullname": "shashwatah/jot", + "rank": 42, + "similarity": 0.6104353666305542 + }, + { + "pb_fullname": "KSXGitHub/parallel-disk-usage", + "rank": 216, + "similarity": 0.5067132115364075 + }, + { + "pb_fullname": "parcel-bundler/lightningcss", + "rank": 160, + "similarity": 0.5015804767608643 + }, + { + "pb_fullname": "rochacbruno/marmite", + "rank": 247, + "similarity": 0.46036940813064575 + }, + { + "pb_fullname": "konradsz/igrep", + "rank": 323, + "similarity": 0.5135867595672607 + }, + { + "pb_fullname": "ivanceras/svgbob", + "rank": 79, + "similarity": 0.5548271536827087 + }, + { + "pb_fullname": "trasta298/keifu", + "rank": 21, + "similarity": 0.6557949781417847 + }, + { + "pb_fullname": "Canop/broot", + "rank": 330, + "similarity": 0.5305018424987793 + }, + { + "pb_fullname": "sharkdp/fd", + "rank": 296, + "similarity": 0.46918368339538574 + }, + { + "pb_fullname": "pls-rs/pls", + "rank": 104, + "similarity": 0.5235198140144348 + }, + { + "pb_fullname": "Byron/dua-cli", + "rank": 258, + "similarity": 0.4793018400669098 + }, + { + "pb_fullname": "mookid/diffr", + "rank": 11, + "similarity": 0.6819955110549927 + }, + { + "pb_fullname": "anordal/shellharden", + "rank": 24, + "similarity": 0.6301349401473999 + }, + { + "pb_fullname": "pier-cli/pier", + "rank": 10, + "similarity": 0.6333513259887695 + }, + { + "pb_fullname": "sharkdp/bat", + "rank": 13, + "similarity": 0.6806105375289917 + }, + { + "pb_fullname": "agourlay/zip-password-finder", + "rank": 458, + "similarity": 0.4874616861343384 + }, + { + "pb_fullname": "jrnxf/thokr", + "rank": 271, + "similarity": 0.528419017791748 + }, + { + "pb_fullname": "wintermute-cell/ngrrram", + "rank": 416, + "similarity": 0.5463178157806396 + }, + { + "pb_fullname": "XAMPPRocky/tokei", + "rank": 28, + "similarity": 0.5558122992515564 + }, + { + "pb_fullname": "wfxr/csview", + "rank": 120, + "similarity": 0.5117825269699097 + }, + { + "pb_fullname": "Y2Z/monolith", + "rank": 386, + "similarity": 0.48531579971313477 + }, + { + "pb_fullname": "yassinebridi/serpl", + "rank": 96, + "similarity": 0.6253212690353394 + }, + { + "pb_fullname": "yoav-lavi/melody", + "rank": 397, + "similarity": 0.4751410186290741 + }, + { + "pb_fullname": "tree-sitter/tree-sitter", + "rank": 121, + "similarity": 0.5411818027496338 + }, + { + "pb_fullname": "yaa110/nomino", + "rank": 45, + "similarity": 0.5418253540992737 + }, + { + "pb_fullname": "YS-L/flamelens", + "rank": 781, + "similarity": 0.47865140438079834 + } + ], + "repo_age": 3.76, + "repo_path": "rust/m1guelpf__auto-commit", + "rust_channel": "stable", + "rust_edition": "2021", + "rust_release_date": "2021-10-21", + "rust_version": "1.56.0", + "rust_version_source": "edition", + "source": "commit:66e0c866d3b69f856da36167dc6e5be3781bd643", + "status": "done", + "url": "https://github.com/m1guelpf/auto-commit" + }, + "instance_id": "m1guelpf__auto-commit.66e0c86", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "m1guelpf/auto-commit" +} diff --git a/m1guelpf--auto-commit.66e0c86/tests/test.sh b/m1guelpf--auto-commit.66e0c86/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/m1guelpf--auto-commit.66e0c86/tests/workspace.tar.gz b/m1guelpf--auto-commit.66e0c86/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..30e94ba28da23c05998fd0a68f9df5aa1464d2a0 --- /dev/null +++ b/m1guelpf--auto-commit.66e0c86/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a5f44300b9480ae2705bf7a892bb195c504416176fc1791d04203172a62007 +size 2219 diff --git a/m4444--tmatrix.dd2b3d7/environment/Dockerfile b/m4444--tmatrix.dd2b3d7/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..736b92148dd4c993902b7d08b80956d73d9819e7 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/Dockerfile @@ -0,0 +1,57 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/m4444--tmatrix.dd2b3d7/environment/download.sh b/m4444--tmatrix.dd2b3d7/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..26e1e16e61c56d0da5577f03ee92b91a12ebe081 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/download.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym download/prefetch stage for M4444/TMatrix. +# +# This file is source'd via `source /source_ro/download.sh`, so it must be +# source-safe: it exports state into the current shell, avoids positional +# arguments, and never calls `exit` on the normal success path. +# +# Responsibility: ensure every build-time dependency of the tmatrix CMake +# build is present on the machine. It performs NO compilation, linking, +# testing, or packaging. The actual offline build happens later in build.sh. +# +# The tmatrix target needs: CMake, a C++17 compiler, the ncurses development +# headers/libraries, and POSIX threads. CMake, g++/gcc and libpthread (part +# of glibc) are already present in the base image. The ncurses development +# package is the only software dependency that may be absent, so it is +# installed here idempotently. + +set -u + +# --------------------------------------------------------------------------- +# 1. Ensure the ncurses development package is installed. +# --------------------------------------------------------------------------- +# build.sh relies on and libncurses at compile/link time, which +# come from the libncurses-dev package (Ubuntu 22.04), which also pulls in +# libncurses6. If the headers are absent, install the package. This branch is +# idempotent: when the headers are already present nothing is done. +ncurses_header="" +if [ -f /usr/include/ncurses.h ]; then + ncurses_header=/usr/include/ncurses.h +elif [ -f /usr/include/ncurses/ncurses.h ]; then + ncurses_header=/usr/include/ncurses/ncurses.h +fi + +if [ -z "$ncurses_header" ]; then + echo "download.sh: installing ncurses development package." + DEBIAN_FRONTEND=noninteractive apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libncurses-dev +fi + +# --------------------------------------------------------------------------- +# 2. Re-verify the ncurses dev headers are now present. +# --------------------------------------------------------------------------- +ncurses_header="" +if [ -f /usr/include/ncurses.h ]; then + ncurses_header=/usr/include/ncurses.h +elif [ -f /usr/include/ncurses/ncurses.h ]; then + ncurses_header=/usr/include/ncurses/ncurses.h +fi +if [ -z "$ncurses_header" ]; then + echo "ERROR: ncurses development headers are required to build tmatrix but were not found." + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# --------------------------------------------------------------------------- +# 3. Verify the CMake toolchain is present. +# --------------------------------------------------------------------------- +cmake_path="$(command -v cmake)" +if [ -z "$cmake_path" ]; then + echo "ERROR: cmake is required to build tmatrix but was not found." + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# --------------------------------------------------------------------------- +# 4. Export the environment that build.sh relies on. +# --------------------------------------------------------------------------- +# Nothing beyond the system toolchain is strictly required for this target. +# Export a marker so build.sh can confirm that the download stage ran. +export TMATRIX_DOWNLOAD_STAGE_DONE=1 + +echo "download.sh: tmatrix dependencies are ready." +echo "download.sh: ncurses headers found at: $ncurses_header" +echo "download.sh: cmake found at: $cmake_path" diff --git a/m4444--tmatrix.dd2b3d7/environment/executable b/m4444--tmatrix.dd2b3d7/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..296fad2ee58d724d4f237cbc923ce849b3545b51 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55ceacfb475bea97f4c05ba6bc390733d20182f7243047819a9795a993226d51 +size 2842536 diff --git a/m4444--tmatrix.dd2b3d7/environment/harbor_prepare_download_env.sh b/m4444--tmatrix.dd2b3d7/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m4444--tmatrix.dd2b3d7/environment/programgym-gcc13.tar.gz b/m4444--tmatrix.dd2b3d7/environment/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/m4444--tmatrix.dd2b3d7/environment/workspace.tar.gz b/m4444--tmatrix.dd2b3d7/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ea439a516e50ee3b488abc2b7ebbdf6455a59595 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:034e755038a8b133f6f723e9db99b9d6b4b45674cf5e3a143b5e7e029e086c49 +size 10823 diff --git a/m4444--tmatrix.dd2b3d7/instruction.md b/m4444--tmatrix.dd2b3d7/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/m4444--tmatrix.dd2b3d7/solution/solve.sh b/m4444--tmatrix.dd2b3d7/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/m4444--tmatrix.dd2b3d7/task.toml b/m4444--tmatrix.dd2b3d7/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e67e4ec09e82b3cf70feb4a4f0686bbfdbe3fa93 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/m4444--tmatrix.dd2b3d7" +description = "Synthetic ProgramGym cleanroom reconstruction task for M4444/TMatrix" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "M4444__TMatrix.dd2b3d7" +repository = "M4444/TMatrix" +commit = "dd2b3d7af0f2cd7879b112d82d1cce542b283d09" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.5961570809161723 +test_branches = 3 +test_count = 1121 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/m4444--tmatrix.dd2b3d7/tests/Dockerfile b/m4444--tmatrix.dd2b3d7/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7ff3c98df93505861b0a050209ad20f385db35f4 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/Dockerfile @@ -0,0 +1,65 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_01.tar.gz b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..90edc4cf7d1ccdf2efe48781415534285e6d2d10 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cd45bbcf1623982e0451eafd3a02d2e2d7308fbd1698cdcafc1d66ab872afbc +size 14704 diff --git a/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_02.tar.gz b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..115c8c70df8463bad6314ae0feb905bc6ff91e1e --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a571d0e470968c07d8cce9235d23edbdc7423b1814347c91b4c031783ff5d449 +size 22122 diff --git a/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_03.tar.gz b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..57ec57967e36ad16f81f06df9e14d5d58959a60c --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:982c28d60035ecc9aab7828e15e645000f120671945cea9cdfc652626a58dc60 +size 16560 diff --git a/m4444--tmatrix.dd2b3d7/tests/download.sh b/m4444--tmatrix.dd2b3d7/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..26e1e16e61c56d0da5577f03ee92b91a12ebe081 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/download.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym download/prefetch stage for M4444/TMatrix. +# +# This file is source'd via `source /source_ro/download.sh`, so it must be +# source-safe: it exports state into the current shell, avoids positional +# arguments, and never calls `exit` on the normal success path. +# +# Responsibility: ensure every build-time dependency of the tmatrix CMake +# build is present on the machine. It performs NO compilation, linking, +# testing, or packaging. The actual offline build happens later in build.sh. +# +# The tmatrix target needs: CMake, a C++17 compiler, the ncurses development +# headers/libraries, and POSIX threads. CMake, g++/gcc and libpthread (part +# of glibc) are already present in the base image. The ncurses development +# package is the only software dependency that may be absent, so it is +# installed here idempotently. + +set -u + +# --------------------------------------------------------------------------- +# 1. Ensure the ncurses development package is installed. +# --------------------------------------------------------------------------- +# build.sh relies on and libncurses at compile/link time, which +# come from the libncurses-dev package (Ubuntu 22.04), which also pulls in +# libncurses6. If the headers are absent, install the package. This branch is +# idempotent: when the headers are already present nothing is done. +ncurses_header="" +if [ -f /usr/include/ncurses.h ]; then + ncurses_header=/usr/include/ncurses.h +elif [ -f /usr/include/ncurses/ncurses.h ]; then + ncurses_header=/usr/include/ncurses/ncurses.h +fi + +if [ -z "$ncurses_header" ]; then + echo "download.sh: installing ncurses development package." + DEBIAN_FRONTEND=noninteractive apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libncurses-dev +fi + +# --------------------------------------------------------------------------- +# 2. Re-verify the ncurses dev headers are now present. +# --------------------------------------------------------------------------- +ncurses_header="" +if [ -f /usr/include/ncurses.h ]; then + ncurses_header=/usr/include/ncurses.h +elif [ -f /usr/include/ncurses/ncurses.h ]; then + ncurses_header=/usr/include/ncurses/ncurses.h +fi +if [ -z "$ncurses_header" ]; then + echo "ERROR: ncurses development headers are required to build tmatrix but were not found." + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# --------------------------------------------------------------------------- +# 3. Verify the CMake toolchain is present. +# --------------------------------------------------------------------------- +cmake_path="$(command -v cmake)" +if [ -z "$cmake_path" ]; then + echo "ERROR: cmake is required to build tmatrix but was not found." + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# --------------------------------------------------------------------------- +# 4. Export the environment that build.sh relies on. +# --------------------------------------------------------------------------- +# Nothing beyond the system toolchain is strictly required for this target. +# Export a marker so build.sh can confirm that the download stage ran. +export TMATRIX_DOWNLOAD_STAGE_DONE=1 + +echo "download.sh: tmatrix dependencies are ready." +echo "download.sh: ncurses headers found at: $ncurses_header" +echo "download.sh: cmake found at: $cmake_path" diff --git a/m4444--tmatrix.dd2b3d7/tests/executable b/m4444--tmatrix.dd2b3d7/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..296fad2ee58d724d4f237cbc923ce849b3545b51 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55ceacfb475bea97f4c05ba6bc390733d20182f7243047819a9795a993226d51 +size 2842536 diff --git a/m4444--tmatrix.dd2b3d7/tests/harbor_prepare_download_env.sh b/m4444--tmatrix.dd2b3d7/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/m4444--tmatrix.dd2b3d7/tests/programgym-gcc13.tar.gz b/m4444--tmatrix.dd2b3d7/tests/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/m4444--tmatrix.dd2b3d7/tests/programgym_evaluator.py b/m4444--tmatrix.dd2b3d7/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/m4444--tmatrix.dd2b3d7/tests/programgym_task.json b/m4444--tmatrix.dd2b3d7/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..e727aac97127969685999b1cef1509733ae29a39 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/programgym_task.json @@ -0,0 +1,1342 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_runtime_input.test_pause_key_keeps_process_alive[lower_p]", + "reasons": [ + { + "detail": "empty executable run failed as expected with returncode=3", + "id": "dummy_pass", + "message": "test passed against the empty executable", + "repair_hint": "Assert concrete black-box executable behavior so an empty executable cannot satisfy the test.", + "severity": "error", + "stage": "dummy_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_colors_title.test_bg_color_valid[bg_black]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_blue]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_cyan]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_default]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_gray]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_green]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_magenta]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_red]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_white]", + "eval.tests.test_colors_title.test_bg_color_valid[bg_yellow]", + "eval.tests.test_colors_title.test_color_empty_value_rejected[bg_empty]", + "eval.tests.test_colors_title.test_color_empty_value_rejected[fg_empty]", + "eval.tests.test_colors_title.test_color_invalid[bg_spaces]", + "eval.tests.test_colors_title.test_color_invalid[bg_unknown]", + "eval.tests.test_colors_title.test_color_invalid[fg_case]", + "eval.tests.test_colors_title.test_color_invalid[fg_leading_space]", + "eval.tests.test_colors_title.test_color_invalid[fg_long_typo]", + "eval.tests.test_colors_title.test_color_invalid[fg_long_unknown]", + "eval.tests.test_colors_title.test_color_invalid[fg_trailing_space]", + "eval.tests.test_colors_title.test_color_invalid[fg_unknown]", + "eval.tests.test_colors_title.test_fg_and_bg_combined_valid", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_black]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_blue]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_cyan]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_default]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_gray]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_green]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_magenta]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_red]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_white]", + "eval.tests.test_colors_title.test_fg_color_long_valid[fg_long_yellow]", + "eval.tests.test_colors_title.test_fg_color_missing_value", + "eval.tests.test_colors_title.test_fg_color_valid[fg_black]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_blue]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_cyan]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_default]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_gray]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_green]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_magenta]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_red]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_white]", + "eval.tests.test_colors_title.test_fg_color_valid[fg_yellow]", + "eval.tests.test_colors_title.test_title_long_empty_is_missing_value", + "eval.tests.test_colors_title.test_title_long_valid[t_long_spaces]", + "eval.tests.test_colors_title.test_title_long_valid[t_long_symbols]", + "eval.tests.test_colors_title.test_title_long_valid[t_long_word]", + "eval.tests.test_colors_title.test_title_missing_value", + "eval.tests.test_colors_title.test_title_valid[empty]", + "eval.tests.test_colors_title.test_title_valid[spaces]", + "eval.tests.test_colors_title.test_title_valid[symbols]", + "eval.tests.test_colors_title.test_title_valid[utf8]", + "eval.tests.test_colors_title.test_title_valid[word]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[bg]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[color]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[fall]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[gap]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[mode]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[start_gap]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[steps]", + "eval.tests.test_error_forms.test_bare_long_option_is_unknown[title]", + "eval.tests.test_error_forms.test_empty_argument_is_unknown", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[bg]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[color]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[fall]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[gap]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[mode]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[start_gap]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[steps]", + "eval.tests.test_error_forms.test_missing_value_long_empty_suffix[title]", + "eval.tests.test_error_forms.test_missing_value_short_option[C]", + "eval.tests.test_error_forms.test_missing_value_short_option[G]", + "eval.tests.test_error_forms.test_missing_value_short_option[c]", + "eval.tests.test_error_forms.test_missing_value_short_option[f]", + "eval.tests.test_error_forms.test_missing_value_short_option[g]", + "eval.tests.test_error_forms.test_missing_value_short_option[l]", + "eval.tests.test_error_forms.test_missing_value_short_option[r]", + "eval.tests.test_error_forms.test_missing_value_short_option[s]", + "eval.tests.test_error_forms.test_missing_value_short_option[t]", + "eval.tests.test_error_forms.test_missing_value_then_stop_no_tui", + "eval.tests.test_error_forms.test_no_arguments_enters_tui_not_error", + "eval.tests.test_error_forms.test_option_like_double_dash_prefix", + "eval.tests.test_error_forms.test_short_option_swallows_trailing_chars_as_value[C_value_z]", + "eval.tests.test_error_forms.test_short_option_swallows_trailing_chars_as_value[c_value_C]", + "eval.tests.test_error_forms.test_short_option_swallows_trailing_chars_as_value[s_value_x]", + "eval.tests.test_error_forms.test_short_option_swallows_trailing_chars_as_value[s_value_y]", + "eval.tests.test_error_forms.test_unknown_error_includes_usage", + "eval.tests.test_error_forms.test_unknown_long_option[background_x]", + "eval.tests.test_error_forms.test_unknown_long_option[bogus]", + "eval.tests.test_error_forms.test_unknown_long_option[colorz]", + "eval.tests.test_error_forms.test_unknown_long_option[double_dash]", + "eval.tests.test_error_forms.test_unknown_long_option[fadee]", + "eval.tests.test_error_forms.test_unknown_long_option[fall]", + "eval.tests.test_error_forms.test_unknown_long_option[gorp]", + "eval.tests.test_error_forms.test_unknown_long_option[no_fade_x]", + "eval.tests.test_error_forms.test_unknown_long_option[rain]", + "eval.tests.test_error_forms.test_unknown_long_option[stp]", + "eval.tests.test_error_forms.test_unknown_short_option[Q]", + "eval.tests.test_error_forms.test_unknown_short_option[Z]", + "eval.tests.test_error_forms.test_unknown_short_option[aa]", + "eval.tests.test_error_forms.test_unknown_short_option[digit]", + "eval.tests.test_error_forms.test_unknown_short_option[j]", + "eval.tests.test_error_forms.test_unknown_short_option[q]", + "eval.tests.test_error_forms.test_unknown_short_option[x]", + "eval.tests.test_error_forms.test_unknown_short_option[z]", + "eval.tests.test_fade.test_fade_combined_with_other_options", + "eval.tests.test_fade.test_fade_flag_parses_cleanly[fade]", + "eval.tests.test_fade.test_fade_flag_parses_cleanly[no_fade]", + "eval.tests.test_fade.test_fade_then_no_fade_parses", + "eval.tests.test_fade.test_fade_with_value_is_unknown[fade_eq_true]", + "eval.tests.test_fade.test_fade_with_value_is_unknown[fade_eq_x]", + "eval.tests.test_fade.test_fade_with_value_is_unknown[no_fade_eq_1]", + "eval.tests.test_fade.test_fade_with_value_is_unknown[no_fade_eq_y]", + "eval.tests.test_fade.test_fall_speed_decimal_branch_forms[both_leading_dot]", + "eval.tests.test_fade.test_fall_speed_decimal_branch_forms[leading_dot]", + "eval.tests.test_fade.test_fall_speed_decimal_branch_forms[mixed]", + "eval.tests.test_fade.test_fall_speed_decimal_branch_forms[trailing_dot]", + "eval.tests.test_fade.test_fall_speed_decimal_branch_forms[trailing_int_max]", + "eval.tests.test_fade.test_no_fade_is_distinct_from_fade", + "eval.tests.test_fade.test_prefix_mismatch_is_unknown[dash_5]", + "eval.tests.test_fade.test_prefix_mismatch_is_unknown[dash_x2]", + "eval.tests.test_fade.test_prefix_mismatch_is_unknown[dashdash_eq_10]", + "eval.tests.test_fade.test_prefix_mismatch_is_unknown[dashdash_y]", + "eval.tests.test_fade.test_single_dash_is_unknown", + "eval.tests.test_fraction_edges.test_fraction_single_digit_accepted[f_frac_0_5]", + "eval.tests.test_fraction_edges.test_fraction_single_digit_accepted[f_frac_7_5]", + "eval.tests.test_fraction_edges.test_fraction_single_digit_accepted[f_max_frac_09_9]", + "eval.tests.test_fraction_edges.test_fraction_single_digit_accepted[f_max_frac_8_9]", + "eval.tests.test_fraction_edges.test_fraction_single_digit_accepted[f_max_frac_9_9]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_frac_too_long_max]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_frac_too_long_max_mid]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_frac_too_long_min]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_leading_dot_frac_too_long]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_three_digit_leading_zero]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_three_digit_max]", + "eval.tests.test_fraction_edges.test_fraction_too_long_rejected[f_three_digit_min]", + "eval.tests.test_mode.test_mode_bare_long_form_is_unknown", + "eval.tests.test_mode.test_mode_dense_followed_by_valid_ok", + "eval.tests.test_mode.test_mode_empty_value_reports_missing", + "eval.tests.test_mode.test_mode_invalid[invalid_DEFAULT]", + "eval.tests.test_mode.test_mode_invalid[invalid_Dense]", + "eval.tests.test_mode.test_mode_invalid[invalid_default]", + "eval.tests.test_mode.test_mode_invalid[invalid_dense]", + "eval.tests.test_mode.test_mode_invalid[invalid_medium]", + "eval.tests.test_mode.test_mode_invalid[invalid_rain]", + "eval.tests.test_mode.test_mode_invalid[invalid_sparse]", + "eval.tests.test_mode.test_mode_valid[mode_default]", + "eval.tests.test_mode.test_mode_valid[mode_dense]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_bad_max]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_bad_min]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_long_max_over_10]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_max_over_10]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_negative]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_no_comma]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_three]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_two_dots]", + "eval.tests.test_ranges.test_fall_speed_invalid_value[f_two_frac_digits]", + "eval.tests.test_ranges.test_fall_speed_min_greater_max[f_order9_8]", + "eval.tests.test_ranges.test_fall_speed_min_greater_max[f_order]", + "eval.tests.test_ranges.test_fall_speed_min_greater_max[f_order_dec]", + "eval.tests.test_ranges.test_fall_speed_min_greater_max[f_order_frac]", + "eval.tests.test_ranges.test_fall_speed_missing_value", + "eval.tests.test_ranges.test_fall_speed_valid[f_decimals]", + "eval.tests.test_ranges.test_fall_speed_valid[f_defaults]", + "eval.tests.test_ranges.test_fall_speed_valid[f_equal]", + "eval.tests.test_ranges.test_fall_speed_valid[f_intpair]", + "eval.tests.test_ranges.test_fall_speed_valid[f_long_defaults]", + "eval.tests.test_ranges.test_fall_speed_valid[f_long_hi_frac]", + "eval.tests.test_ranges.test_fall_speed_valid[f_max_exactly_10]", + "eval.tests.test_ranges.test_fall_speed_valid[f_zero_frac]", + "eval.tests.test_ranges.test_fall_speed_valid[f_zero_zero]", + "eval.tests.test_ranges.test_first_bad_range_then_later_option_stops", + "eval.tests.test_ranges.test_gap_invalid_value[g_bad_max]", + "eval.tests.test_ranges.test_gap_invalid_value[g_bad_min]", + "eval.tests.test_ranges.test_gap_invalid_value[g_no_comma]", + "eval.tests.test_ranges.test_gap_min_greater_max", + "eval.tests.test_ranges.test_gap_valid[g_defaults]", + "eval.tests.test_ranges.test_gap_valid[g_equal]", + "eval.tests.test_ranges.test_gap_valid[g_long_defaults]", + "eval.tests.test_ranges.test_gap_valid[g_zero]", + "eval.tests.test_ranges.test_length_invalid_value[l_bad_max]", + "eval.tests.test_ranges.test_length_invalid_value[l_min_zero]", + "eval.tests.test_ranges.test_length_invalid_value[l_negative]", + "eval.tests.test_ranges.test_length_invalid_value[l_no_comma]", + "eval.tests.test_ranges.test_length_invalid_value[l_zero_zero]", + "eval.tests.test_ranges.test_length_valid[l_2_5]", + "eval.tests.test_ranges.test_length_valid[l_5_5]", + "eval.tests.test_ranges.test_length_valid[l_defaults]", + "eval.tests.test_ranges.test_length_valid[l_equal_min]", + "eval.tests.test_ranges.test_multiple_ranges_valid", + "eval.tests.test_ranges.test_start_gap_invalid_value[G_bad_max]", + "eval.tests.test_ranges.test_start_gap_invalid_value[G_bad_min]", + "eval.tests.test_ranges.test_start_gap_invalid_value[G_no_comma]", + "eval.tests.test_ranges.test_start_gap_min_greater_max", + "eval.tests.test_ranges.test_start_gap_valid[G_defaults]", + "eval.tests.test_ranges.test_start_gap_valid[G_equal]", + "eval.tests.test_ranges.test_start_gap_valid[G_long_defaults]", + "eval.tests.test_ranges.test_start_gap_valid[G_zero]", + "eval.tests.test_ranges.test_update_rate_invalid_value[r_bad_min]", + "eval.tests.test_ranges.test_update_rate_invalid_value[r_no_comma]", + "eval.tests.test_ranges.test_update_rate_min_greater_max", + "eval.tests.test_ranges.test_update_rate_valid[r_defaults]", + "eval.tests.test_ranges.test_update_rate_valid[r_equal]", + "eval.tests.test_ranges.test_update_rate_valid[r_zero_allowed]", + "eval.tests.test_ranges.test_update_rate_valid[r_zero_zero]", + "eval.tests.test_runtime_input.test_other_key_is_ignored_for_lifetime[a]", + "eval.tests.test_runtime_input.test_other_key_is_ignored_for_lifetime[enter]", + "eval.tests.test_runtime_input.test_other_key_is_ignored_for_lifetime[space]", + "eval.tests.test_runtime_input.test_other_key_is_ignored_for_lifetime[x]", + "eval.tests.test_runtime_input.test_pause_key_keeps_process_alive[lower_p]", + "eval.tests.test_runtime_input.test_pause_key_keeps_process_alive[upper_p]", + "eval.tests.test_runtime_input.test_pause_then_quit_still_exits", + "eval.tests.test_runtime_input.test_quit_after_warmup_with_options", + "eval.tests.test_runtime_input.test_quit_is_clean_exit_not_hang", + "eval.tests.test_runtime_input.test_quit_key_terminates_process[lower_q]", + "eval.tests.test_runtime_input.test_quit_key_terminates_process[upper_q]", + "eval.tests.test_runtime_input.test_quit_terminates_with_nonzero_status", + "eval.tests.test_runtime_input.test_repeated_pause_then_quit", + "eval.tests.test_steps_per_second.test_multiple_steps_instances_last_wins_valid", + "eval.tests.test_steps_per_second.test_steps_long_space_form_is_unknown", + "eval.tests.test_steps_per_second.test_steps_missing_value_at_end", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_-5]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_0]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_100]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_1x]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_3.5]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_61]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_--steps-per-sec_abc]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_ 5]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_+7]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_-5]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_0]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_1.0]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_5 ]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_61]", + "eval.tests.test_steps_per_second.test_steps_per_second_invalid[invalid_-s_abc]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[leading_zero_accepted]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[long_default]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[long_lower_bound]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[long_mid]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[long_upper_bound]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[short_default]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[short_lower_bound]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[short_min]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[short_upper_bound]", + "eval.tests.test_steps_per_second.test_steps_per_second_valid[short_upper_minus_1]", + "eval.tests.test_steps_per_second.test_steps_value_looking_like_option_is_invalid", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[color_swallows_long_opt]", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[f_swallows_short]", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[g_swallows_short]", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[s_swallows_rangetxt]", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[s_swallows_short_leftover_ignored]", + "eval.tests.test_value_consumption.test_short_option_consumes_next_token[s_swallows_version]", + "eval.tests.test_value_consumption.test_text_short_swallows_option_like_token_as_title[title_swallows_5]", + "eval.tests.test_value_consumption.test_text_short_swallows_option_like_token_as_title[title_swallows_default]", + "eval.tests.test_value_consumption.test_text_short_swallows_option_like_token_as_title[title_swallows_help]", + "eval.tests.test_value_consumption.test_text_short_swallows_option_like_token_as_title[title_swallows_s]", + "eval.tests.test_value_consumption.test_text_short_swallows_option_like_token_as_title[title_swallows_version]", + "eval.tests.test_version_help.test_error_before_version_stops_first[bad_mode]", + "eval.tests.test_version_help.test_error_before_version_stops_first[steps_no_eq]", + "eval.tests.test_version_help.test_error_before_version_stops_first[title_no_eq]", + "eval.tests.test_version_help.test_first_terminating_option_wins", + "eval.tests.test_version_help.test_help_contains_usage_first_line", + "eval.tests.test_version_help.test_help_exact_stdout", + "eval.tests.test_version_help.test_help_is_deterministic_across_runs", + "eval.tests.test_version_help.test_help_short_form_is_unknown", + "eval.tests.test_version_help.test_long_flag_terminating_accepted[help]", + "eval.tests.test_version_help.test_long_flag_terminating_accepted[version]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[Cap_version]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[help_eq]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[single_help]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[single_version]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[upper_help]", + "eval.tests.test_version_help.test_long_flag_variants_rejected[version_eq_x]", + "eval.tests.test_version_help.test_version_exact_stdout", + "eval.tests.test_version_help.test_version_short_form_is_unknown", + "eval.tests.test_version_help.test_version_when_preceded_by_valid_option" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_help_version.test_help_documents_default_properties", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_help_version.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_help_version.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_arg_validation.test_background_color_invalid_exact_diagnostic[purple]", + "eval.tests.test_arg_validation.test_background_color_invalid_exact_diagnostic[rainbow]", + "eval.tests.test_arg_validation.test_background_color_invalid_exact_diagnostic[steel]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[black]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[blue]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[cyan]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[default]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[gray]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[green]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[magenta]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[red]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[white]", + "eval.tests.test_arg_validation.test_background_color_valid_accepted[yellow]", + "eval.tests.test_arg_validation.test_char_update_rate_invalid_exact_diagnostic[1]", + "eval.tests.test_arg_validation.test_char_update_rate_invalid_exact_diagnostic[]", + "eval.tests.test_arg_validation.test_char_update_rate_invalid_exact_diagnostic[a,3]", + "eval.tests.test_arg_validation.test_char_update_rate_reversed_exact_diagnostic[2,1]", + "eval.tests.test_arg_validation.test_char_update_rate_valid[0,20]", + "eval.tests.test_arg_validation.test_char_update_rate_valid[10,20]", + "eval.tests.test_arg_validation.test_char_update_rate_valid[5,7]", + "eval.tests.test_arg_validation.test_color_empty_value_exact_missing_diagnostic", + "eval.tests.test_arg_validation.test_color_invalid_exact_diagnostic[chartreuse]", + "eval.tests.test_arg_validation.test_color_invalid_exact_diagnostic[greenblue]", + "eval.tests.test_arg_validation.test_color_invalid_exact_diagnostic[orange]", + "eval.tests.test_arg_validation.test_color_invalid_exact_diagnostic[purple]", + "eval.tests.test_arg_validation.test_color_valid_accepted[black]", + "eval.tests.test_arg_validation.test_color_valid_accepted[blue]", + "eval.tests.test_arg_validation.test_color_valid_accepted[cyan]", + "eval.tests.test_arg_validation.test_color_valid_accepted[default]", + "eval.tests.test_arg_validation.test_color_valid_accepted[gray]", + "eval.tests.test_arg_validation.test_color_valid_accepted[green]", + "eval.tests.test_arg_validation.test_color_valid_accepted[magenta]", + "eval.tests.test_arg_validation.test_color_valid_accepted[red]", + "eval.tests.test_arg_validation.test_color_valid_accepted[white]", + "eval.tests.test_arg_validation.test_color_valid_accepted[yellow]", + "eval.tests.test_arg_validation.test_dense_mode_with_extra_property_options_valid", + "eval.tests.test_arg_validation.test_fall_speed_large_value_only_exact_diagnostic", + "eval.tests.test_arg_validation.test_fall_speed_leading_decimal_accepted", + "eval.tests.test_arg_validation.test_fall_speed_malformed_range_exact_diagnostic[1.05,2]", + "eval.tests.test_arg_validation.test_fall_speed_malformed_range_exact_diagnostic[1.2.3,5]", + "eval.tests.test_arg_validation.test_fall_speed_min_greater_than_max_exact[10.0-1.0]", + "eval.tests.test_arg_validation.test_fall_speed_min_greater_than_max_exact[2-1]", + "eval.tests.test_arg_validation.test_fall_speed_min_greater_than_max_exact[3-2]", + "eval.tests.test_arg_validation.test_fall_speed_no_comma_exact_diagnostic", + "eval.tests.test_arg_validation.test_fall_speed_reversed_range_exact_diagnostic[1,.5]", + "eval.tests.test_arg_validation.test_fall_speed_reversed_range_exact_diagnostic[10.1,3]", + "eval.tests.test_arg_validation.test_fall_speed_reversed_range_exact_diagnostic[2,1]", + "eval.tests.test_arg_validation.test_fall_speed_trailing_point_decimal_accepted", + "eval.tests.test_arg_validation.test_fall_speed_valid_range_accepted[0.5-1.5]", + "eval.tests.test_arg_validation.test_fall_speed_valid_range_accepted[1-2]", + "eval.tests.test_arg_validation.test_fall_speed_valid_range_accepted[10.0-10.0]", + "eval.tests.test_arg_validation.test_fall_speed_zero_to_zero_accepted", + "eval.tests.test_arg_validation.test_flag_with_value_suffix_exact_diagnostic[--fade=x]", + "eval.tests.test_arg_validation.test_flag_with_value_suffix_exact_diagnostic[--help=x]", + "eval.tests.test_arg_validation.test_flag_with_value_suffix_exact_diagnostic[--no-fade=x]", + "eval.tests.test_arg_validation.test_flag_with_value_suffix_exact_diagnostic[--version=x]", + "eval.tests.test_arg_validation.test_gap_range_reversed_exact_diagnostic[--gap=-2,0]", + "eval.tests.test_arg_validation.test_gap_range_reversed_exact_diagnostic[--start-gap=-4,1]", + "eval.tests.test_arg_validation.test_gap_range_reversed_exact_diagnostic[-G-5,2]", + "eval.tests.test_arg_validation.test_gap_range_reversed_exact_diagnostic[-g-3,1]", + "eval.tests.test_arg_validation.test_gap_range_valid_accepted[--gap=-1,1]", + "eval.tests.test_arg_validation.test_gap_range_valid_accepted[--start-gap=-1,2]", + "eval.tests.test_arg_validation.test_gap_range_valid_accepted[-G-10,30]", + "eval.tests.test_arg_validation.test_gap_range_valid_accepted[-g-0,40]", + "eval.tests.test_arg_validation.test_length_less_than_min_rejected_exact[-1,5]", + "eval.tests.test_arg_validation.test_length_less_than_min_rejected_exact[0,0]", + "eval.tests.test_arg_validation.test_length_less_than_min_rejected_exact[0,5]", + "eval.tests.test_arg_validation.test_length_less_than_min_rejected_exact[a,b]", + "eval.tests.test_arg_validation.test_length_min_greater_than_max_exact", + "eval.tests.test_arg_validation.test_length_min_ok_accepted[1,1]", + "eval.tests.test_arg_validation.test_length_min_ok_accepted[1,30]", + "eval.tests.test_arg_validation.test_length_min_ok_accepted[3,7]", + "eval.tests.test_arg_validation.test_lone_long_option_requires_equals_exact[--color]", + "eval.tests.test_arg_validation.test_lone_long_option_requires_equals_exact[--gap]", + "eval.tests.test_arg_validation.test_lone_long_option_requires_equals_exact[--start-gap]", + "eval.tests.test_arg_validation.test_lone_long_option_requires_equals_exact[--steps-per-sec]", + "eval.tests.test_arg_validation.test_lone_long_option_requires_equals_exact[--title]", + "eval.tests.test_arg_validation.test_long_title_equals_form_accepted", + "eval.tests.test_arg_validation.test_mode_empty_value_exact_missing_diagnostic", + "eval.tests.test_arg_validation.test_mode_invalid_exact_diagnostic[DEFAULT]", + "eval.tests.test_arg_validation.test_mode_invalid_exact_diagnostic[Matrix]", + "eval.tests.test_arg_validation.test_mode_valid_accepted[default]", + "eval.tests.test_arg_validation.test_mode_valid_accepted[dense]", + "eval.tests.test_arg_validation.test_multiple_valid_options_then_version", + "eval.tests.test_arg_validation.test_steps_per_sec_boundary_accepted[10]", + "eval.tests.test_arg_validation.test_steps_per_sec_boundary_accepted[1]", + "eval.tests.test_arg_validation.test_steps_per_sec_boundary_accepted[60]", + "eval.tests.test_arg_validation.test_steps_per_sec_invalid_exact_diagnostic[-s--5]", + "eval.tests.test_arg_validation.test_steps_per_sec_invalid_exact_diagnostic[-s-0]", + "eval.tests.test_arg_validation.test_steps_per_sec_invalid_exact_diagnostic[-s-1.5]", + "eval.tests.test_arg_validation.test_steps_per_sec_invalid_exact_diagnostic[-s-61]", + "eval.tests.test_arg_validation.test_steps_per_sec_invalid_exact_diagnostic[-s-abc]", + "eval.tests.test_arg_validation.test_steps_per_sec_long_form_equal", + "eval.tests.test_arg_validation.test_steps_per_sec_one_argument_short_exact_diagnostic", + "eval.tests.test_arg_validation.test_title_accepted[A]", + "eval.tests.test_arg_validation.test_title_accepted[HELLO]", + "eval.tests.test_arg_validation.test_title_accepted[Matrix]", + "eval.tests.test_arg_validation.test_title_accepted[]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--background]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--color]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--help-extra]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--mode]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[--unknown]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[-]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[-h]", + "eval.tests.test_arg_validation.test_unknown_option_exact_full_diagnostic[-z]", + "eval.tests.test_arg_validation.test_version_short_circuits_after_invalid_option_exact", + "eval.tests.test_arg_validation.test_version_short_circuits_after_valid_option", + "eval.tests.test_engine_runtime.test_multiple_resizes_sustain_render", + "eval.tests.test_engine_runtime.test_near_integer_speed_steps_far_less_than_integer", + "eval.tests.test_engine_runtime.test_quantized_speed_gap_scales_glyph_volume[1.9,1.9-3.0,3.0]", + "eval.tests.test_engine_runtime.test_quantized_speed_gap_scales_glyph_volume[2.8,2.8-4.0,4.0]", + "eval.tests.test_engine_runtime.test_quantized_speed_gap_scales_glyph_volume[6.2,6.2-8.0,8.0]", + "eval.tests.test_engine_runtime.test_quit_after_pause_terminates", + "eval.tests.test_engine_runtime.test_quit_immediately_after_start_terminates", + "eval.tests.test_engine_runtime.test_quit_key_terminates_process[Q]", + "eval.tests.test_engine_runtime.test_quit_key_terminates_process[q]", + "eval.tests.test_engine_runtime.test_quit_within_fast_render_painted_glyphs", + "eval.tests.test_engine_runtime.test_resize_keeps_rendering[0.3]", + "eval.tests.test_engine_runtime.test_resize_keeps_rendering[0.7]", + "eval.tests.test_engine_runtime.test_resize_redraws_custom_title", + "eval.tests.test_engine_runtime.test_resize_then_quit_keeps_rendering_between", + "eval.tests.test_engine_runtime.test_resize_then_quit_rebuilt_engine", + "eval.tests.test_engine_runtime.test_resize_zero_fall_speed_still_flushes_frames", + "eval.tests.test_engine_runtime.test_short_window_constant_glyph_activity[5]", + "eval.tests.test_engine_runtime.test_short_window_constant_glyph_activity[8]", + "eval.tests.test_engine_runtime.test_short_window_sustains_recycling[5]", + "eval.tests.test_engine_runtime.test_short_window_sustains_recycling[6]", + "eval.tests.test_engine_runtime.test_short_window_sustains_recycling[8]", + "eval.tests.test_engine_runtime.test_sub_integer_above_one_builds_varied_step_arrays[1.2,1.2]", + "eval.tests.test_engine_runtime.test_sub_integer_above_one_builds_varied_step_arrays[1.5,1.5]", + "eval.tests.test_engine_runtime.test_sub_integer_above_one_builds_varied_step_arrays[1.8,1.8]", + "eval.tests.test_engine_runtime.test_tiny_window_fast_recycle_no_stall", + "eval.tests.test_engine_runtime.test_unknown_key_does_not_quit[ ]", + "eval.tests.test_engine_runtime.test_unknown_key_does_not_quit[\\r]", + "eval.tests.test_engine_runtime.test_unknown_key_does_not_quit[\\x1b]", + "eval.tests.test_engine_runtime.test_unknown_key_does_not_quit[a]", + "eval.tests.test_engine_runtime.test_unknown_key_does_not_quit[x]", + "eval.tests.test_headless.test_invalid_parse_does_not_attempt_terminal[args0]", + "eval.tests.test_headless.test_invalid_parse_does_not_attempt_terminal[args1]", + "eval.tests.test_headless.test_invalid_parse_does_not_attempt_terminal[args2]", + "eval.tests.test_headless.test_no_terminal_error_on_stderr", + "eval.tests.test_headless.test_no_terminal_with_dense", + "eval.tests.test_headless.test_terminal_failure_is_stderr_not_stdout", + "eval.tests.test_help_version.test_flag_then_nothing_else_terminates[--help]", + "eval.tests.test_help_version.test_flag_then_nothing_else_terminates[--version]", + "eval.tests.test_help_version.test_help_documents_default_properties", + "eval.tests.test_help_version.test_help_documents_every_option", + "eval.tests.test_help_version.test_help_documents_modes", + "eval.tests.test_help_version.test_help_documents_range_semantics", + "eval.tests.test_help_version.test_help_documents_runtime_commands", + "eval.tests.test_help_version.test_help_exit_zero", + "eval.tests.test_help_version.test_help_first_line_is_usage", + "eval.tests.test_help_version.test_version_exact", + "eval.tests.test_help_version.test_version_stdout_not_empty", + "eval.tests.test_rain_engine.test_background_color_escape_emitted[blue-\\x1b[44m]", + "eval.tests.test_rain_engine.test_background_color_escape_emitted[cyan-\\x1b[46m]", + "eval.tests.test_rain_engine.test_background_color_escape_emitted[magenta-\\x1b[45m]", + "eval.tests.test_rain_engine.test_background_color_escape_emitted[red-\\x1b[41m]", + "eval.tests.test_rain_engine.test_background_color_escape_emitted[yellow-\\x1b[43m]", + "eval.tests.test_rain_engine.test_custom_title_replaces_default_title", + "eval.tests.test_rain_engine.test_decimal_fixed_fall_speed_renders_glyphs", + "eval.tests.test_rain_engine.test_default_title_letters_drawn", + "eval.tests.test_rain_engine.test_fade_character_color_shade[blue-\\x1b[38;5;33m]", + "eval.tests.test_rain_engine.test_fade_character_color_shade[cyan-\\x1b[38;5;51m]", + "eval.tests.test_rain_engine.test_fade_character_color_shade[magenta-\\x1b[38;5;201m]", + "eval.tests.test_rain_engine.test_fade_character_color_shade[red-\\x1b[38;5;196m]", + "eval.tests.test_rain_engine.test_fade_character_color_shade[yellow-\\x1b[38;5;226m]", + "eval.tests.test_rain_engine.test_fast_char_update_rate_flickers_glyphs", + "eval.tests.test_rain_engine.test_high_fixed_fall_speed_draws_more_glyphs_than_default", + "eval.tests.test_rain_engine.test_large_inter_streak_gap_still_rains", + "eval.tests.test_rain_engine.test_large_starting_gap_delays_streak_creation", + "eval.tests.test_rain_engine.test_max_boundary_fall_speed_renders", + "eval.tests.test_rain_engine.test_nofade_character_color_body[blue-\\x1b[34m]", + "eval.tests.test_rain_engine.test_nofade_character_color_body[cyan-\\x1b[36m]", + "eval.tests.test_rain_engine.test_nofade_character_color_body[gray-\\x1b[90m]", + "eval.tests.test_rain_engine.test_nofade_character_color_body[magenta-\\x1b[35m]", + "eval.tests.test_rain_engine.test_nofade_character_color_body[red-\\x1b[31m]", + "eval.tests.test_rain_engine.test_nofade_character_color_body[yellow-\\x1b[33m]", + "eval.tests.test_rain_engine.test_nofade_character_color_keeps_white_glowing_head", + "eval.tests.test_rain_engine.test_single_fixed_fall_speed_renders_glyphs", + "eval.tests.test_rain_engine.test_slow_char_update_rate_keeps_glyphs_stable", + "eval.tests.test_rain_engine.test_small_inter_streak_gap_keeps_raining", + "eval.tests.test_rain_engine.test_spaced_title_draws_only_non_space_letters", + "eval.tests.test_rain_engine.test_starting_gap_zero_draws_more_than_large", + "eval.tests.test_rain_engine.test_title_letters_drawn_alongside_rain_body", + "eval.tests.test_rain_engine.test_title_renders_in_nofade_with_white_foreground", + "eval.tests.test_rain_engine.test_zero_fall_speed_renders_frames_but_no_glyphs", + "eval.tests.test_rain_engine.test_zero_starting_gap_creates_streaks_immediately", + "eval.tests.test_raincolumn_engine.test_all_space_title_draws_no_letters", + "eval.tests.test_raincolumn_engine.test_different_sub_integer_speeds_advance_at_rate", + "eval.tests.test_raincolumn_engine.test_fractional_speed_variants_render_glyphs[1.1,1.1]", + "eval.tests.test_raincolumn_engine.test_fractional_speed_variants_render_glyphs[2.5,2.5]", + "eval.tests.test_raincolumn_engine.test_fractional_speed_variants_render_glyphs[3.7,3.7]", + "eval.tests.test_raincolumn_engine.test_fractional_speed_variants_render_glyphs[5.3,5.3]", + "eval.tests.test_raincolumn_engine.test_fractional_speed_variants_render_glyphs[8.2,8.2]", + "eval.tests.test_raincolumn_engine.test_oversized_title_still_renders", + "eval.tests.test_raincolumn_engine.test_pause_press_still_leaves_a_render[1]", + "eval.tests.test_raincolumn_engine.test_pause_press_still_leaves_a_render[3]", + "eval.tests.test_raincolumn_engine.test_pause_stops_cursor_home_flushes", + "eval.tests.test_raincolumn_engine.test_single_character_title_drawn", + "eval.tests.test_raincolumn_engine.test_small_starting_gap_delays_then_renders", + "eval.tests.test_raincolumn_engine.test_speed_increases_glyph_movement_not_frame_rate", + "eval.tests.test_raincolumn_engine.test_speed_one_draws_more_than_sub_integer", + "eval.tests.test_raincolumn_engine.test_sub_integer_speed_over_long_window_eventually_steps", + "eval.tests.test_raincolumn_engine.test_sub_integer_speed_renders_frames_but_not_glyphs[0.1,0.1]", + "eval.tests.test_raincolumn_engine.test_sub_integer_speed_renders_frames_but_not_glyphs[0.2,0.2]", + "eval.tests.test_raincolumn_engine.test_sub_integer_speed_renders_frames_but_not_glyphs[0.5,0.5]", + "eval.tests.test_raincolumn_engine.test_tall_window_keeps_recycling_streaks", + "eval.tests.test_raincolumn_engine.test_tight_inter_streak_gap_draws_more_than_sparse", + "eval.tests.test_raincolumn_engine.test_tiny_window_renders_frames_without_error", + "eval.tests.test_raincolumn_engine.test_title_cells_and_body_coexist_in_one_render", + "eval.tests.test_raincolumn_engine.test_wider_fractional_speed_draws_more_glyphs[1.2,1.2-1.5,1.5]", + "eval.tests.test_raincolumn_engine.test_wider_fractional_speed_draws_more_glyphs[1.5,1.5-2.3,2.3]", + "eval.tests.test_raincolumn_engine.test_wider_fractional_speed_draws_more_glyphs[2.3,2.3-3.1,3.1]", + "eval.tests.test_raincolumn_engine.test_zero_step_columns_still_flush_a_frame_per_update[cfg0]", + "eval.tests.test_raincolumn_engine.test_zero_step_columns_still_flush_a_frame_per_update[cfg1]", + "eval.tests.test_render.test_custom_fall_speed_renders", + "eval.tests.test_render.test_custom_step_rate_renders", + "eval.tests.test_render.test_default_mode_emits_matrix_glyphs", + "eval.tests.test_render.test_default_mode_renders_frames", + "eval.tests.test_render.test_default_mode_uses_color_shades", + "eval.tests.test_render.test_dense_is_nofade_plain_fg", + "eval.tests.test_render.test_dense_mode_draws_more_glyphs_than_default", + "eval.tests.test_render.test_dense_more_glowing_heads", + "eval.tests.test_render.test_fade_emits_glowing_head", + "eval.tests.test_render.test_fade_mode_uses_shades_not_plain_fg", + "eval.tests.test_render.test_fast_steps_many_frames", + "eval.tests.test_render.test_larger_window_more_columns", + "eval.tests.test_render.test_long_streak_length_renders", + "eval.tests.test_render.test_more_columns_more_glyphs", + "eval.tests.test_render.test_no_fade_emits_glowing_head", + "eval.tests.test_render.test_no_fade_still_draws_glyphs", + "eval.tests.test_render.test_no_fade_uses_plain_foreground", + "eval.tests.test_render.test_no_more_output_after_termination", + "eval.tests.test_render.test_nondefault_gap_range_renders", + "eval.tests.test_render.test_slow_steps_fewer_frames", + "eval.tests.test_render.test_tiny_streak_length_still_renders", + "eval.tests.test_render.test_title_painted_in_glowing_color", + "eval.tests.test_render.test_zero_update_rate_no_change" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_terminal_detection.test_version_banner_is_exact_golden", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_terminal_detection.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_terminal_detection.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_terminal_runtime.test_pause_and_terminate_sequence", + "reasons": [ + { + "id": "try_except_swallow", + "message": "pytest test swallows exceptions in an except handler", + "path": "eval/tests/test_terminal_runtime.py", + "repair_hint": "Do not swallow exceptions; let pytest fail or assert the exact expected exception.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_time_dependency", + "message": "test appears to depend on wall-clock time", + "path": "eval/tests/test_terminal_runtime.py", + "repair_hint": "Avoid wall-clock assertions or freeze/normalize time-dependent output.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_terminal_runtime.test_pause_mode_keeps_terminal_setup_bytes", + "reasons": [ + { + "id": "try_except_swallow", + "message": "pytest test swallows exceptions in an except handler", + "path": "eval/tests/test_terminal_runtime.py", + "repair_hint": "Do not swallow exceptions; let pytest fail or assert the exact expected exception.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_terminal_runtime.test_pause_then_resume_restarts_flushing", + "reasons": [ + { + "id": "try_except_swallow", + "message": "pytest test swallows exceptions in an except handler", + "path": "eval/tests/test_terminal_runtime.py", + "repair_hint": "Do not swallow exceptions; let pytest fail or assert the exact expected exception.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[black]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[blue]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[cyan]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[default]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[gray]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[green]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[magenta]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[red]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[white]", + "eval.tests.test_color_full_shades.test_shade3_is_distinct_from_uniform_shade4_tail[yellow]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[black]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[blue]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[cyan]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[default]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[gray]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[green]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[magenta]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[red]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[white]", + "eval.tests.test_color_full_shades.test_single_fade_run_carries_all_four_shades[yellow]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-black]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-blue]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-cyan]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-default]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-gray]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-green]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-magenta]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-red]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-white]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args0-yellow]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-black]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-blue]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-cyan]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-default]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-gray]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-green]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-magenta]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-red]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-white]", + "eval.tests.test_color_geometry.test_background_colour_spanning_spellings[args1-yellow]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[black]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[blue]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[cyan]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[default]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[gray]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[green]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[magenta]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[red]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[white]", + "eval.tests.test_color_geometry.test_each_shade1_escape_is_distinct_and_rendered_fade[yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[1-1-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-3-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[2-80-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[3-6-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-4-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[4-8-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[5-40-yellow]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-black]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-blue]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-cyan]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-default]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-gray]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-green]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-magenta]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-red]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-white]", + "eval.tests.test_color_geometry.test_fade_cell_count_matches_geometry[6-2-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[black-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[blue-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[cyan-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[default-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[gray-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[green-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[magenta-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[red-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[white-yellow]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-black]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-blue]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-cyan]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-default]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-gray]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-green]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-magenta]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-red]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-white]", + "eval.tests.test_color_geometry.test_fg_and_bg_colours_are_independent[yellow-yellow]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[1-1]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[2-3]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[2-80]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[3-6]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[4-4]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[4-8]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[5-40]", + "eval.tests.test_color_geometry.test_flush_marker_terminates_every_geometry[6-2]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-black]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-blue]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-cyan]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-default]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-gray]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-green]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-magenta]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-red]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-white]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args0-yellow]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-black]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-blue]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-cyan]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-default]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-gray]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-green]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-magenta]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-red]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-white]", + "eval.tests.test_color_geometry.test_foreground_colour_spanning_spellings[args1-yellow]", + "eval.tests.test_color_geometry.test_invalid_value_long_form_reported_precisely[--background-fade]", + "eval.tests.test_color_geometry.test_invalid_value_long_form_reported_precisely[--background-no]", + "eval.tests.test_color_geometry.test_invalid_value_long_form_reported_precisely[--color-navy]", + "eval.tests.test_color_geometry.test_invalid_value_long_form_reported_precisely[--color-purple]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-C-1]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-C-PINK]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-C-green2]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-C-purple]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-c-dark]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-c-purple]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-c-rgb]", + "eval.tests.test_color_geometry.test_invalid_value_short_form_reported_precisely[-c-x]", + "eval.tests.test_color_geometry.test_missing_colour_value_reports_usage[args0-No value specified for -C]", + "eval.tests.test_color_geometry.test_missing_colour_value_reports_usage[args1-No value specified for -c]", + "eval.tests.test_color_geometry.test_missing_colour_value_reports_usage[args2-No value specified for --color=]", + "eval.tests.test_color_geometry.test_missing_colour_value_reports_usage[args3-No value specified for --background=]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[black]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[blue]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[cyan]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[default]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[gray]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[green]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[magenta]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[red]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[white]", + "eval.tests.test_color_geometry.test_mode_dense_uses_nofade_foreground[yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[1-1-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-3-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[2-80-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[3-6-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-4-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[4-8-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[5-40-yellow]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-black]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-blue]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-cyan]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-default]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-gray]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-green]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-magenta]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-red]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-white]", + "eval.tests.test_color_geometry.test_nofade_cell_count_matches_geometry[6-2-yellow]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[black]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[blue]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[cyan]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[default]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[gray]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[green]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[magenta]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[red]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[white]", + "eval.tests.test_color_geometry.test_shade1_differs_from_own_foreground[yellow]", + "eval.tests.test_color_geometry.test_unknown_option_reported[--colorz]", + "eval.tests.test_color_geometry.test_unknown_option_reported[--nope]", + "eval.tests.test_color_geometry.test_unknown_option_reported[-Z]", + "eval.tests.test_color_geometry.test_unknown_option_reported[-x]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[black]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[blue]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[cyan]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[default]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[gray]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[green]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[magenta]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[red]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[white]", + "eval.tests.test_shade_evolution.test_background_sequence_persists_in_steady_state[yellow]", + "eval.tests.test_shade_evolution.test_default_mode_is_fading_and_draws_shade_bands", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[black]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[blue]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[cyan]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[default]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[gray]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[green]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[magenta]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[red]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[white]", + "eval.tests.test_shade_evolution.test_fade_emits_shade2_3_through_shade4[yellow]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[black]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[blue]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[cyan]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[default]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[gray]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[green]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[magenta]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[red]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[white]", + "eval.tests.test_shade_evolution.test_no_fade_documents_shade_band_absence[yellow]", + "eval.tests.test_shade_evolution.test_nofade_mode_has_no_deeper_shade_bands[--mode=dense]", + "eval.tests.test_shade_evolution.test_nofade_mode_has_no_deeper_shade_bands[--no-fade]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[black]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[blue]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[cyan]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[default]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[gray]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[green]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[magenta]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[red]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[white]", + "eval.tests.test_shade_evolution.test_shade_bands_shrink_toward_the_tail[yellow]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[black]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[blue]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[cyan]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[default]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[gray]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[green]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[magenta]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[red]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[white]", + "eval.tests.test_shade_evolution.test_tail_carries_hardcoded_shade4[yellow]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[black]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[blue]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[cyan]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[default]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[gray]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[green]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[magenta]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[red]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[white]", + "eval.tests.test_terminal.test_background_colour_emitted_after_bold[yellow]", + "eval.tests.test_terminal.test_background_long_form_option[black]", + "eval.tests.test_terminal.test_background_long_form_option[blue]", + "eval.tests.test_terminal.test_background_long_form_option[cyan]", + "eval.tests.test_terminal.test_background_long_form_option[default]", + "eval.tests.test_terminal.test_background_long_form_option[gray]", + "eval.tests.test_terminal.test_background_long_form_option[green]", + "eval.tests.test_terminal.test_background_long_form_option[magenta]", + "eval.tests.test_terminal.test_background_long_form_option[red]", + "eval.tests.test_terminal.test_background_long_form_option[white]", + "eval.tests.test_terminal.test_background_long_form_option[yellow]", + "eval.tests.test_terminal.test_bold_on_sequence_always_emitted", + "eval.tests.test_terminal.test_buffer_size_matches_terminal_geometry", + "eval.tests.test_terminal.test_character_color_long_form_option[black]", + "eval.tests.test_terminal.test_character_color_long_form_option[blue]", + "eval.tests.test_terminal.test_character_color_long_form_option[cyan]", + "eval.tests.test_terminal.test_character_color_long_form_option[default]", + "eval.tests.test_terminal.test_character_color_long_form_option[gray]", + "eval.tests.test_terminal.test_character_color_long_form_option[green]", + "eval.tests.test_terminal.test_character_color_long_form_option[magenta]", + "eval.tests.test_terminal.test_character_color_long_form_option[red]", + "eval.tests.test_terminal.test_character_color_long_form_option[white]", + "eval.tests.test_terminal.test_character_color_long_form_option[yellow]", + "eval.tests.test_terminal.test_default_invocation_is_fading_green_black_bg", + "eval.tests.test_terminal.test_dense_mode_no_fade_default_background", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[black]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[blue]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[cyan]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[default]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[gray]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[green]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[magenta]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[red]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[white]", + "eval.tests.test_terminal.test_each_valid_background_starts_tui[yellow]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[black]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[blue]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[cyan]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[default]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[gray]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[green]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[magenta]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[red]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[white]", + "eval.tests.test_terminal.test_each_valid_color_starts_tui[yellow]", + "eval.tests.test_terminal.test_explicit_fade_flag", + "eval.tests.test_terminal.test_fade_and_nofade_cell_prefix_length_differs", + "eval.tests.test_terminal.test_fade_and_nofade_identical_terminal_geometry", + "eval.tests.test_terminal.test_flush_moves_cursor_home", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[black]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[blue]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[cyan]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[default]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[gray]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[green]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[magenta]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[red]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[white]", + "eval.tests.test_terminal.test_foreground_fade_cleared_cell_uses_shade1[yellow]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[black]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[blue]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[cyan]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[default]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[gray]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[green]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[magenta]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[red]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[white]", + "eval.tests.test_terminal.test_foreground_no_fade_cleared_cell[yellow]", + "eval.tests.test_terminal.test_invalid_background_color_rejected[dark]", + "eval.tests.test_terminal.test_invalid_background_color_rejected[purple]", + "eval.tests.test_terminal.test_invalid_background_color_rejected[rgb]", + "eval.tests.test_terminal.test_invalid_background_color_rejected[x]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[ brown]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[1]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[PINK]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[fade]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[green2]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[navy]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[no]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[purple]", + "eval.tests.test_terminal.test_invalid_character_color_rejected[turquoise]", + "eval.tests.test_terminal.test_missing_character_color_value", + "eval.tests.test_terminal.test_no_fade_flag_disables_fade", + "eval.tests.test_terminal.test_rendering_loop_continues_flushing", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-black]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-blue]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-cyan]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-default]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-gray]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-green]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-magenta]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-red]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-white]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[--background=-yellow]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-black]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-blue]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-cyan]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-default]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-gray]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-green]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-magenta]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-red]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-white]", + "eval.tests.test_terminal_detection.test_background_color_then_no_terminal_fails[-c-yellow]", + "eval.tests.test_terminal_detection.test_combined_valid_options_then_no_terminal_fails[args0]", + "eval.tests.test_terminal_detection.test_combined_valid_options_then_no_terminal_fails[args1]", + "eval.tests.test_terminal_detection.test_combined_valid_options_then_no_terminal_fails[args2]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-black]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-blue]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-cyan]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-default]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-gray]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-green]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-magenta]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-red]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-white]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[--color=-yellow]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-black]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-blue]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-cyan]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-default]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-gray]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-green]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-magenta]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-red]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-white]", + "eval.tests.test_terminal_detection.test_foreground_color_then_no_terminal_fails[-C-yellow]", + "eval.tests.test_terminal_detection.test_info_commands_never_open_a_terminal[args0]", + "eval.tests.test_terminal_detection.test_info_commands_never_open_a_terminal[args1]", + "eval.tests.test_terminal_detection.test_mode_then_no_terminal_fails[--fade]", + "eval.tests.test_terminal_detection.test_mode_then_no_terminal_fails[--mode=default]", + "eval.tests.test_terminal_detection.test_mode_then_no_terminal_fails[--mode=dense]", + "eval.tests.test_terminal_detection.test_mode_then_no_terminal_fails[--no-fade]", + "eval.tests.test_terminal_detection.test_mode_then_no_terminal_fails[default]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v0]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v1]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v2]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v3]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v4]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v5]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v6]", + "eval.tests.test_terminal_detection.test_parser_error_returns_before_terminal_setup[args_v7]", + "eval.tests.test_terminal_detection.test_unusable_term_env_fails_deterministically[args0]", + "eval.tests.test_terminal_detection.test_unusable_term_env_fails_deterministically[args1]", + "eval.tests.test_terminal_detection.test_unusable_term_env_fails_deterministically[args2]", + "eval.tests.test_terminal_detection.test_unusable_term_env_fails_deterministically[args3]", + "eval.tests.test_terminal_detection.test_version_banner_is_exact_golden", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--fade-a]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--fade-b]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--fade-x]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--fade-z]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--no-fade-a]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--no-fade-b]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--no-fade-x]", + "eval.tests.test_terminal_runtime.test_non_command_key_neither_terminates_nor_stops_rendering[--no-fade-z]", + "eval.tests.test_terminal_runtime.test_pause_and_terminate_sequence", + "eval.tests.test_terminal_runtime.test_pause_key_halts_flushing[args0]", + "eval.tests.test_terminal_runtime.test_pause_key_halts_flushing[args1]", + "eval.tests.test_terminal_runtime.test_pause_mode_keeps_terminal_setup_bytes", + "eval.tests.test_terminal_runtime.test_pause_then_resume_restarts_flushing", + "eval.tests.test_terminal_runtime.test_terminate_key_exits_after_rendering_frame[args0-Q]", + "eval.tests.test_terminal_runtime.test_terminate_key_exits_after_rendering_frame[args0-q]", + "eval.tests.test_terminal_runtime.test_terminate_key_exits_after_rendering_frame[args1-Q]", + "eval.tests.test_terminal_runtime.test_terminate_key_exits_after_rendering_frame[args1-q]", + "eval.tests.test_terminal_runtime.test_title_option_accepted_and_renderer_proceeds[HELLO]", + "eval.tests.test_terminal_runtime.test_title_option_accepted_and_renderer_proceeds[THE MATRIX]", + "eval.tests.test_terminal_runtime.test_title_option_accepted_and_renderer_proceeds[TMATRIX]", + "eval.tests.test_terminal_runtime.test_title_option_accepted_and_renderer_proceeds[abc]" + ] + } + }, + "commit": "dd2b3d7af0f2cd7879b112d82d1cce542b283d09", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5961570809161723, + "eval_clean_hashes": [ + "55ceacfb475bea97f4c05ba6bc390733d20182f7243047819a9795a993226d51" + ], + "input_record": { + "commit": "dd2b3d7af0f2cd7879b112d82d1cce542b283d09", + "difficulty": "easy", + "difficulty_code_lines": 1973, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1973, + "difficulty_runtime_deps": 1, + "difficulty_score": 1.5961570809161723, + "difficulty_test_code_lines": 0, + "full_name": "M4444/TMatrix", + "input_joern_zip": "cpp_joern/M4444__TMatrix.zip", + "joern_status": true, + "joern_time": 11.34115589200519, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "ArthurSonzogni/json-tui", + "rank": 806, + "similarity": 0.44940000772476196 + }, + { + "pb_fullname": "tstack/lnav", + "rank": 516, + "similarity": 0.44616246223449707 + }, + { + "pb_fullname": "NikolaDucak/caps-log", + "rank": 453, + "similarity": 0.41130274534225464 + }, + { + "pb_fullname": "HaliteChallenge/Halite", + "rank": 373, + "similarity": 0.45907509326934814 + } + ], + "repo_path": "cpp/M4444__TMatrix", + "source": "commit:dd2b3d7af0f2cd7879b112d82d1cce542b283d09", + "status": "done", + "url": "https://github.com/M4444/TMatrix" + }, + "instance_id": "M4444__TMatrix.dd2b3d7", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 3, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "M4444/TMatrix" +} diff --git a/m4444--tmatrix.dd2b3d7/tests/test.sh b/m4444--tmatrix.dd2b3d7/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/m4444--tmatrix.dd2b3d7/tests/workspace.tar.gz b/m4444--tmatrix.dd2b3d7/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ea439a516e50ee3b488abc2b7ebbdf6455a59595 --- /dev/null +++ b/m4444--tmatrix.dd2b3d7/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:034e755038a8b133f6f723e9db99b9d6b4b45674cf5e3a143b5e7e029e086c49 +size 10823 diff --git a/maaslalani--draw.1220ebb/environment/Dockerfile b/maaslalani--draw.1220ebb/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/maaslalani--draw.1220ebb/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/maaslalani--draw.1220ebb/environment/download.sh b/maaslalani--draw.1220ebb/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..195c44c90efde7f8e72a140552e818932d8825e1 --- /dev/null +++ b/maaslalani--draw.1220ebb/environment/download.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maaslalani/draw + +go 1.18 + +require ( + github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc + github.com/charmbracelet/lipgloss v0.9.1 +) + +require ( + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/reflow v0.3.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/charmbracelet/bubbletea v0.24.2 h1:uaQIKx9Ai6Gdh5zpTbGiWpytMU+CfsPp06RaW2cx/SY= +github.com/charmbracelet/bubbletea v0.24.2/go.mod h1:XdrNrV4J8GiyshTtx3DNuYkR1FDaJmO3l2nejekbsgg= +github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc h1:0c6Pnfm9khMK1eaNIYQX7zAUFyWsbRmAAvd0HeqAtzk= +github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= +github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg= +github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= +github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maaslalani--draw.1220ebb/environment/executable b/maaslalani--draw.1220ebb/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..d87c60e0c2838a998d6744d467879b6438162719 --- /dev/null +++ b/maaslalani--draw.1220ebb/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1d5e498745b058f0a1ce5b045f329296d77db7ecf6a22e5d0c3a0fbe883a35a +size 3861732 diff --git a/maaslalani--draw.1220ebb/environment/programgym-go.tar.gz b/maaslalani--draw.1220ebb/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maaslalani--draw.1220ebb/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maaslalani--draw.1220ebb/environment/workspace.tar.gz b/maaslalani--draw.1220ebb/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b9a3790c0928c0c89a5403aec6f975fb8a2ef482 --- /dev/null +++ b/maaslalani--draw.1220ebb/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc70a9a95e8f6413fb6d163a1a9f4ec728016f7382d0f7cb338c45c34409c012 +size 933554 diff --git a/maaslalani--draw.1220ebb/instruction.md b/maaslalani--draw.1220ebb/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/maaslalani--draw.1220ebb/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/maaslalani--draw.1220ebb/solution/solve.sh b/maaslalani--draw.1220ebb/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/maaslalani--draw.1220ebb/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/maaslalani--draw.1220ebb/task.toml b/maaslalani--draw.1220ebb/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6c17731f81bbe9a60077085334d83388be3001a4 --- /dev/null +++ b/maaslalani--draw.1220ebb/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/maaslalani--draw.1220ebb" +description = "Synthetic ProgramGym cleanroom reconstruction task for maaslalani/draw" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "maaslalani__draw.1220ebb" +repository = "maaslalani/draw" +commit = "1220ebb8c5411f1eb09a0e87be606a7768180917" +language = "go" +difficulty = "easy" +difficulty_score = 1.8474492624991727 +test_branches = 3 +test_count = 67 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/maaslalani--draw.1220ebb/tests/Dockerfile b/maaslalani--draw.1220ebb/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_01.tar.gz b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..93ba0717fbb6ff7bb69a86d84c6da88cfa7edb8f --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b29766c79f2461891f47c795dcf5b6b212e7fc85031729c7b1d7da780693879 +size 9940 diff --git a/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_03.tar.gz b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8edcf8621c0efc7fe5fd2decf4691bef1b04dd54 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05d5e095c3d6457e236ddc200bc529586c117e6da3e7d07ede14df8f57260fba +size 7759 diff --git a/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_04.tar.gz b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..12d26c1042f51437da0141d4b37804367a310bfc --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af6916d3130f9d6cbddbad908d629a665c869a41e498060beaa9348385f764d1 +size 6958 diff --git a/maaslalani--draw.1220ebb/tests/download.sh b/maaslalani--draw.1220ebb/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..195c44c90efde7f8e72a140552e818932d8825e1 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/download.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maaslalani/draw + +go 1.18 + +require ( + github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc + github.com/charmbracelet/lipgloss v0.9.1 +) + +require ( + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/reflow v0.3.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/charmbracelet/bubbletea v0.24.2 h1:uaQIKx9Ai6Gdh5zpTbGiWpytMU+CfsPp06RaW2cx/SY= +github.com/charmbracelet/bubbletea v0.24.2/go.mod h1:XdrNrV4J8GiyshTtx3DNuYkR1FDaJmO3l2nejekbsgg= +github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc h1:0c6Pnfm9khMK1eaNIYQX7zAUFyWsbRmAAvd0HeqAtzk= +github.com/charmbracelet/bubbletea v0.24.3-0.20231204165059-a154847611cc/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg= +github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg= +github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= +github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maaslalani--draw.1220ebb/tests/executable b/maaslalani--draw.1220ebb/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..d87c60e0c2838a998d6744d467879b6438162719 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1d5e498745b058f0a1ce5b045f329296d77db7ecf6a22e5d0c3a0fbe883a35a +size 3861732 diff --git a/maaslalani--draw.1220ebb/tests/programgym-go.tar.gz b/maaslalani--draw.1220ebb/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maaslalani--draw.1220ebb/tests/programgym_evaluator.py b/maaslalani--draw.1220ebb/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/maaslalani--draw.1220ebb/tests/programgym_task.json b/maaslalani--draw.1220ebb/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..8d0041034bca3dab9e883a80ca0884218da1cd9c --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/programgym_task.json @@ -0,0 +1,450 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_help_and_flags.test_dash_help_prints_full_help_text_and_exits_zero", + "eval.tests.test_help_and_flags.test_dash_help_prints_trailing_newline_after_header", + "eval.tests.test_help_and_flags.test_dash_help_true_form_is_treated_like_help", + "eval.tests.test_help_and_flags.test_flag_help_shorthands_do_not_launch_tui", + "eval.tests.test_help_and_flags.test_help_can_appear_after_other_flags", + "eval.tests.test_help_and_flags.test_help_documents_default_draw_file_location", + "eval.tests.test_help_and_flags.test_two_dash_unknown_flag_exits_two", + "eval.tests.test_help_and_flags.test_unknown_flag_reports_flag_error_to_stderr", + "eval.tests.test_help_and_flags.test_unknown_flag_usage_lists_help_option", + "eval.tests.test_main_io.test_clean_pty_quit_default_draw_file_path_used", + "eval.tests.test_main_io.test_clean_pty_quit_positional_arg_overrides_draw_file", + "eval.tests.test_main_io.test_clean_pty_quit_trailing_newline_is_trimmed", + "eval.tests.test_main_io.test_clean_pty_quit_writes_to_draw_file_env_variable", + "eval.tests.test_main_io.test_draw_file_env_does_not_avoid_tui_without_tty", + "eval.tests.test_main_io.test_help_false_still_enters_tui_and_fails_without_tty", + "eval.tests.test_main_io.test_plain_run_without_tty_reports_tty_error", + "eval.tests.test_main_io.test_positional_arg_still_enters_tui_and_fails_without_tty", + "eval.tests.test_main_io.test_pty_quit_plain_run_expands_grid_after_real_keypress", + "eval.tests.test_math_drawing.test_box_forward_click_draws_border_glyphs", + "eval.tests.test_math_drawing.test_box_reversed_click_order_draws_identical_box", + "eval.tests.test_math_drawing.test_diagonal_drag_normalises_to_axis_aligned_box", + "eval.tests.test_math_drawing.test_equal_point_drag_draws_single_cell", + "eval.tests.test_math_drawing.test_horizontal_line_drag_draws_dashes", + "eval.tests.test_math_drawing.test_vertical_line_drag_draws_pipes" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_anchor.TestShapeAnchor.test_left_click_draws_brush_character_at_cell", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '*' Strings contain only whitespace, escaping them using repr() - '*' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestShapeAnchor.test_second_right_click_draws_box_from_anchor", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '\u250c' Strings contain only whitespace, escaping them using repr() - '\u250c' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorBoundary.test_anchor_bottom_row_enter_does_not_advance", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'q' Strings contain only whitespace, escaping them using repr() - 'q' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorBoundary.test_type_at_right_edge_does_not_run_off_canvas", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'B' Strings contain only whitespace, escaping them using repr() - 'B' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_overwrites_own_cell_on_advance", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'a' Strings contain only whitespace, escaping them using repr() - 'a' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_single_char_at_anchor", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'H' Strings contain only whitespace, escaping them using repr() - 'H' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[*]", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '*' Strings contain only whitespace, escaping them using repr() - '*' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[Z]", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'Z' Strings contain only whitespace, escaping them using repr() - 'Z' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[x]", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'x' Strings contain only whitespace, escaping them using repr() - 'x' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorInsert.test_type_word_advances_anchor_right", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == ['c', 'a', 't'] + where ['c', 'a', 't'] = list('cat')", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorNavigation.test_backspace_cuts_cell_just_left_of_anchor", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'a' Strings contain only whitespace, escaping them using repr() - 'a' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorNavigation.test_enter_moves_text_insert_to_next_line", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'X' Strings contain only whitespace, escaping them using repr() - 'X' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_anchor.TestTextAnchorReset.test_escape_stops_text_insertion", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == 'H' Strings contain only whitespace, escaping them using repr() - 'H' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_canvas.TestBoxRestorePrecondition.test_box_draw_restore_discards_draws_made_after_anchor_set", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '*' Strings contain only whitespace, escaping them using repr() - '*' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_canvas.TestUndoRestore.test_undo_after_second_click_restores_first_backup", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '*' Strings contain only whitespace, escaping them using repr() - '*' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_canvas.TestUndoRestore.test_undo_then_redraw_writes_clean_cells", + "reasons": [ + { + "detail": "AssertionError: assert ' ' == '*' Strings contain only whitespace, escaping them using repr() - '*' + ' '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_help.test_help_prints_usage_and_exits_zero[-h]", + "reasons": [ + { + "detail": "AssertionError: assert 'Usage: draw [file]' in ''", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_anchor.TestShapeAnchor.test_left_click_draws_brush_character_at_cell", + "eval.tests.test_anchor.TestShapeAnchor.test_release_at_different_cell_does_not_set_text_anchor", + "eval.tests.test_anchor.TestShapeAnchor.test_second_right_click_draws_box_from_anchor", + "eval.tests.test_anchor.TestTextAnchorBoundary.test_anchor_bottom_row_enter_does_not_advance", + "eval.tests.test_anchor.TestTextAnchorBoundary.test_type_at_right_edge_does_not_run_off_canvas", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_overwrites_own_cell_on_advance", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_single_char_at_anchor", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[*]", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[Z]", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_uses_typed_character_as_brush_and_inserted_text[x]", + "eval.tests.test_anchor.TestTextAnchorInsert.test_type_word_advances_anchor_right", + "eval.tests.test_anchor.TestTextAnchorNavigation.test_backspace_at_left_edge_is_idempotent", + "eval.tests.test_anchor.TestTextAnchorNavigation.test_backspace_cuts_cell_just_left_of_anchor", + "eval.tests.test_anchor.TestTextAnchorNavigation.test_enter_moves_text_insert_to_next_line", + "eval.tests.test_anchor.TestTextAnchorReset.test_escape_stops_text_insertion", + "eval.tests.test_canvas.TestBoxRestorePrecondition.test_box_draw_restore_discards_draws_made_after_anchor_set", + "eval.tests.test_canvas.TestUndoRestore.test_undo_after_second_click_restores_first_backup", + "eval.tests.test_canvas.TestUndoRestore.test_undo_erases_left_click_draw", + "eval.tests.test_canvas.TestUndoRestore.test_undo_reverts_box_to_pre_anchor_state", + "eval.tests.test_canvas.TestUndoRestore.test_undo_then_redraw_writes_clean_cells", + "eval.tests.test_help.test_help_does_not_write_any_output_file", + "eval.tests.test_help.test_help_mentions_mouse_box_and_text_anchor", + "eval.tests.test_help.test_help_prints_usage_and_exits_zero[--help]", + "eval.tests.test_help.test_help_prints_usage_and_exits_zero[-h]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_shapes.test_box_then_horizontal_line_overlay", + "eval.tests.test_shapes.test_box_then_vertical_line_overlay", + "eval.tests.test_shapes.test_box_touching_bottom_edge", + "eval.tests.test_shapes.test_box_touching_right_edge", + "eval.tests.test_shapes.test_crossing_lines_plus_shape", + "eval.tests.test_shapes.test_draw_box_exact[10-4-2-2-9-3]", + "eval.tests.test_shapes.test_draw_box_exact[12-5-2-2-9-3]", + "eval.tests.test_shapes.test_draw_box_exact[12-6-4-5-10-2]", + "eval.tests.test_shapes.test_draw_box_exact[12-6-9-5-3-2]", + "eval.tests.test_shapes.test_draw_box_exact[12-7-3-6-10-3]", + "eval.tests.test_shapes.test_draw_box_exact[12-9-2-2-9-8]", + "eval.tests.test_shapes.test_draw_box_exact[12-9-9-8-2-2]", + "eval.tests.test_shapes.test_draw_box_exact[6-4-2-2-3-3]", + "eval.tests.test_shapes.test_draw_box_exact[6-5-2-2-4-4]", + "eval.tests.test_shapes.test_draw_box_exact[6-8-2-2-3-6]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[10-6-7-2-3-2]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[12-5-2-3-9-3]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[12-5-9-3-2-3]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[12-6-3-2-10-2]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[16-6-2-4-15-4]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[6-5-2-2-2-2]", + "eval.tests.test_shapes.test_draw_horizontal_line_exact[8-7-5-4-5-4]", + "eval.tests.test_shapes.test_draw_shape_dispatches_to_box[2-2-7-6]", + "eval.tests.test_shapes.test_draw_shape_dispatches_to_line[2-3-8-3]", + "eval.tests.test_shapes.test_draw_shape_dispatches_to_line[4-2-4-9]", + "eval.tests.test_shapes.test_draw_vertical_line_exact[6-10-3-2-3-9]", + "eval.tests.test_shapes.test_draw_vertical_line_exact[6-10-3-9-3-2]", + "eval.tests.test_shapes.test_draw_vertical_line_exact[6-12-5-3-5-11]", + "eval.tests.test_shapes.test_draw_vertical_line_exact[6-8-2-7-2-3]", + "eval.tests.test_shapes.test_draw_vertical_line_exact[6-8-4-3-4-7]", + "eval.tests.test_shapes.test_horizontal_line_touching_right_edge", + "eval.tests.test_shapes.test_large_box_nonzero_interior", + "eval.tests.test_shapes.test_reverse_box_is_normalised", + "eval.tests.test_shapes.test_single_point_uses_vertical_glyph", + "eval.tests.test_shapes.test_two_adjacent_boxes", + "eval.tests.test_shapes.test_vertical_line_touching_bottom_edge" + ] + } + }, + "commit": "1220ebb8c5411f1eb09a0e87be606a7768180917", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.8474492624991727, + "eval_clean_hashes": [ + "f1d5e498745b058f0a1ce5b045f329296d77db7ecf6a22e5d0c3a0fbe883a35a" + ], + "input_record": { + "commit": "1220ebb8c5411f1eb09a0e87be606a7768180917", + "commits": 40, + "contributors": 4, + "difficulty": "easy", + "difficulty_code_lines": 391, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 391, + "difficulty_runtime_deps": 17, + "difficulty_score": 1.8474492624991727, + "difficulty_test_code_lines": 0, + "full_name": "maaslalani/draw", + "github_stars": 541, + "input_joern_zip": "go_joern/maaslalani__draw.zip", + "joern_status": true, + "joern_time": 12.340966113843024, + "language": "go", + "pb_match": [ + { + "pb_fullname": "antonmedv/walk", + "rank": 190, + "similarity": 0.533390998840332 + }, + { + "pb_fullname": "peco/peco", + "rank": 863, + "similarity": 0.4624335765838623 + }, + { + "pb_fullname": "alecthomas/chroma", + "rank": 357, + "similarity": 0.5006932020187378 + }, + { + "pb_fullname": "jesseduffield/lazygit", + "rank": 429, + "similarity": 0.5297683477401733 + }, + { + "pb_fullname": "rs/jplot", + "rank": 199, + "similarity": 0.5487475395202637 + }, + { + "pb_fullname": "sheepla/pingu", + "rank": 294, + "similarity": 0.5124080777168274 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 30, + "similarity": 0.6204873323440552 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 33, + "similarity": 0.5709750652313232 + }, + { + "pb_fullname": "cheat/cheat", + "rank": 592, + "similarity": 0.5032762885093689 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 528, + "similarity": 0.5005068778991699 + } + ], + "repo_age": 4.31, + "repo_path": "go/maaslalani__draw", + "source": "commit:1220ebb8c5411f1eb09a0e87be606a7768180917", + "status": "done", + "url": "https://github.com/maaslalani/draw" + }, + "instance_id": "maaslalani__draw.1220ebb", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "maaslalani/draw" +} diff --git a/maaslalani--draw.1220ebb/tests/test.sh b/maaslalani--draw.1220ebb/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/maaslalani--draw.1220ebb/tests/workspace.tar.gz b/maaslalani--draw.1220ebb/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b9a3790c0928c0c89a5403aec6f975fb8a2ef482 --- /dev/null +++ b/maaslalani--draw.1220ebb/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc70a9a95e8f6413fb6d163a1a9f4ec728016f7382d0f7cb338c45c34409c012 +size 933554 diff --git a/maaslalani--typer.0e674b2/environment/Dockerfile b/maaslalani--typer.0e674b2/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/maaslalani--typer.0e674b2/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/maaslalani--typer.0e674b2/environment/download.sh b/maaslalani--typer.0e674b2/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5ce8d937a9ec109c77848277265431aa8f3c1fa9 --- /dev/null +++ b/maaslalani--typer.0e674b2/environment/download.sh @@ -0,0 +1,417 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maaslalani/typer + +go 1.16 + +require ( + github.com/charmbracelet/bubbles v0.7.7 + github.com/charmbracelet/bubbletea v0.13.2 + github.com/guptarohit/asciigraph v0.5.5 + github.com/mitchellh/go-homedir v1.1.0 + github.com/mitchellh/go-wordwrap v1.0.1 + github.com/muesli/termenv v0.8.1 + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cobra v1.1.3 + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/viper v1.7.1 + github.com/stretchr/testify v1.4.0 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/charmbracelet/bubbles v0.7.7 h1:eVsAYiAJskifXaqHpPzbOZS1srMaTnuiTazC6uukBbA= +github.com/charmbracelet/bubbles v0.7.7/go.mod h1:5WX1sSSjNCgCrzvRMN/z23HxvWaa+AI16Ch0KPZPeDs= +github.com/charmbracelet/bubbletea v0.13.1/go.mod h1:tp9tr9Dadh0PLhgiwchE5zZJXm5543JYjHG9oY+5qSg= +github.com/charmbracelet/bubbletea v0.13.2 h1:fSOx3q0/VbA3ChWeiNcUsNeNysD9FFWD1tZypShBuCQ= +github.com/charmbracelet/bubbletea v0.13.2/go.mod h1:okqaA5VF0aSpEZ2HB+L/cxVw2HthIDZ1dmWoRZs8/4g= +github.com/charmbracelet/lipgloss v0.1.2/go.mod h1:5D8zradw52m7QmxRF6QgwbwJi9je84g8MkWiGN07uKg= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/guptarohit/asciigraph v0.5.5 h1:ccFnUF8xYIOUPPY3tmdvRyHqmn1MYI9iv1pLKX+/ZkQ= +github.com/guptarohit/asciigraph v0.5.5/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9FnmSjdbWUlLGvcxrY0Rw3ATltrxOhk= +github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= +github.com/muesli/termenv v0.7.2/go.mod h1:ct2L5N2lmix82RaY3bMWwVu/jUFc9Ule0KGDCiKYPh8= +github.com/muesli/termenv v0.8.1 h1:9q230czSP3DHVpkaPDXGp0TOfAwyjyYwXlUCQxQSaBk= +github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maaslalani--typer.0e674b2/environment/executable b/maaslalani--typer.0e674b2/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..a02325224a350c0847361b93e1bf2e953b947670 --- /dev/null +++ b/maaslalani--typer.0e674b2/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c27cc1e645d6c7a73a344a099cc86464ace2c3f144396c2cc4894f655d45ebb6 +size 13733278 diff --git a/maaslalani--typer.0e674b2/environment/programgym-go.tar.gz b/maaslalani--typer.0e674b2/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maaslalani--typer.0e674b2/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maaslalani--typer.0e674b2/environment/workspace.tar.gz b/maaslalani--typer.0e674b2/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..64ddf8a575f457778f2159ca6174b5c6a4c252b8 --- /dev/null +++ b/maaslalani--typer.0e674b2/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ce6d017d703427e1e54fff08c28e5867471e9159d8f5550b41f98103f4592af +size 2232 diff --git a/maaslalani--typer.0e674b2/instruction.md b/maaslalani--typer.0e674b2/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/maaslalani--typer.0e674b2/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/maaslalani--typer.0e674b2/solution/solve.sh b/maaslalani--typer.0e674b2/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/maaslalani--typer.0e674b2/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/maaslalani--typer.0e674b2/task.toml b/maaslalani--typer.0e674b2/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7912ea8b6b9a6176076c1468919d2b1aec788e5b --- /dev/null +++ b/maaslalani--typer.0e674b2/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/maaslalani--typer.0e674b2" +description = "Synthetic ProgramGym cleanroom reconstruction task for maaslalani/typer" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "maaslalani__typer.0e674b2" +repository = "maaslalani/typer" +commit = "0e674b236154b05f89fb4f5bee20c7269fd71477" +language = "go" +difficulty = "easy" +difficulty_score = 1.984977126415493 +test_branches = 4 +test_count = 326 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/maaslalani--typer.0e674b2/tests/Dockerfile b/maaslalani--typer.0e674b2/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_01.tar.gz b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0cec9095e284639e7705c157c7bb0fb0186647be --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:920a9d450a0ea48f62e5e20e64f40293b0066218323585337cd0c7c2b81d58e3 +size 9432 diff --git a/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_02.tar.gz b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..43fac381743cf9efff511a800457dab36bca058c --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e4caf1952ea1b4c33cd1af06eb06a137164489af15715b1281f562d03abdbcf +size 5897 diff --git a/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_03.tar.gz b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e66458756a7e8273f0a772954322eb363b3cc89d --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19b80da8c22dce0ec03f13fef8e3633ffb03772c8b449eeaeb1630b0bef1ce91 +size 6831 diff --git a/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_04.tar.gz b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4271b802d349706700227cb960f26c72c822831a --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9209e6f3a6d9fbbba142cd8362ffa36bb2a2f8a149eb821bf7970ce38119c48 +size 8389 diff --git a/maaslalani--typer.0e674b2/tests/download.sh b/maaslalani--typer.0e674b2/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5ce8d937a9ec109c77848277265431aa8f3c1fa9 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/download.sh @@ -0,0 +1,417 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maaslalani/typer + +go 1.16 + +require ( + github.com/charmbracelet/bubbles v0.7.7 + github.com/charmbracelet/bubbletea v0.13.2 + github.com/guptarohit/asciigraph v0.5.5 + github.com/mitchellh/go-homedir v1.1.0 + github.com/mitchellh/go-wordwrap v1.0.1 + github.com/muesli/termenv v0.8.1 + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cobra v1.1.3 + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/viper v1.7.1 + github.com/stretchr/testify v1.4.0 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/charmbracelet/bubbles v0.7.7 h1:eVsAYiAJskifXaqHpPzbOZS1srMaTnuiTazC6uukBbA= +github.com/charmbracelet/bubbles v0.7.7/go.mod h1:5WX1sSSjNCgCrzvRMN/z23HxvWaa+AI16Ch0KPZPeDs= +github.com/charmbracelet/bubbletea v0.13.1/go.mod h1:tp9tr9Dadh0PLhgiwchE5zZJXm5543JYjHG9oY+5qSg= +github.com/charmbracelet/bubbletea v0.13.2 h1:fSOx3q0/VbA3ChWeiNcUsNeNysD9FFWD1tZypShBuCQ= +github.com/charmbracelet/bubbletea v0.13.2/go.mod h1:okqaA5VF0aSpEZ2HB+L/cxVw2HthIDZ1dmWoRZs8/4g= +github.com/charmbracelet/lipgloss v0.1.2/go.mod h1:5D8zradw52m7QmxRF6QgwbwJi9je84g8MkWiGN07uKg= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/guptarohit/asciigraph v0.5.5 h1:ccFnUF8xYIOUPPY3tmdvRyHqmn1MYI9iv1pLKX+/ZkQ= +github.com/guptarohit/asciigraph v0.5.5/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9FnmSjdbWUlLGvcxrY0Rw3ATltrxOhk= +github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= +github.com/muesli/termenv v0.7.2/go.mod h1:ct2L5N2lmix82RaY3bMWwVu/jUFc9Ule0KGDCiKYPh8= +github.com/muesli/termenv v0.8.1 h1:9q230czSP3DHVpkaPDXGp0TOfAwyjyYwXlUCQxQSaBk= +github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maaslalani--typer.0e674b2/tests/executable b/maaslalani--typer.0e674b2/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..a02325224a350c0847361b93e1bf2e953b947670 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c27cc1e645d6c7a73a344a099cc86464ace2c3f144396c2cc4894f655d45ebb6 +size 13733278 diff --git a/maaslalani--typer.0e674b2/tests/programgym-go.tar.gz b/maaslalani--typer.0e674b2/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maaslalani--typer.0e674b2/tests/programgym_evaluator.py b/maaslalani--typer.0e674b2/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/maaslalani--typer.0e674b2/tests/programgym_task.json b/maaslalani--typer.0e674b2/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..6824f77816956f297e020bd7bf30d11f42f08380 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/programgym_task.json @@ -0,0 +1,482 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[config-missing-arg]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[file-missing-arg]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[length-float]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[length-missing-arg]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[length-negative-garbage]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[length-non-int]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[min-word-length-non-int]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[monkeytype-language-missing-arg]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[unknown-long-flag-2]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[unknown-long-flag]", + "eval.tests.test_cli.TestCobraArgErrors.test_flag_parse_errors_exit_1[unknown-short-flag]", + "eval.tests.test_cli.TestCobraArgErrors.test_invalid_flag_does_not_start_tui", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_duplicate_length_last_wins", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[capital-false]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[capital-true]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[equals-length-max]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[equals-length]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[file-empty-string]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[min-word-length-eq-zero]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[monkeytype-language-empty]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[punctuation-false]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_equals_form_flags_parse_to_runner[punctuation-true]", + "eval.tests.test_cli.TestCobraSyntaxVariants.test_short_length_flag", + "eval.tests.test_cli.TestCombinedFlags.test_combined_short_flags", + "eval.tests.test_cli.TestCombinedFlags.test_default_no_args_dispatch_random", + "eval.tests.test_cli.TestCombinedFlags.test_long_flags_combined", + "eval.tests.test_cli.TestConfigDefaultHomeNotLoaded.test_default_home_config_present_but_not_reported", + "eval.tests.test_cli.TestConfigDefaultHomeNotLoaded.test_default_home_empty_dir_not_reported", + "eval.tests.test_cli.TestConfigDefaultHomeNotLoaded.test_same_file_via_explicit_config_is_reported", + "eval.tests.test_cli.TestConfigLoading.test_config_plus_stdin_still_loads_config", + "eval.tests.test_cli.TestConfigLoading.test_malformed_config_is_silently_ignored", + "eval.tests.test_cli.TestConfigLoading.test_missing_config_is_silently_ignored", + "eval.tests.test_cli.TestConfigLoading.test_valid_config_reports_file_on_stderr", + "eval.tests.test_cli.TestConfigLoading.test_valid_config_then_reaches_run", + "eval.tests.test_cli.TestConfigVariants.test_config_flag_named_keys_are_not_bound", + "eval.tests.test_cli.TestConfigVariants.test_config_pointing_at_directory_is_ignored", + "eval.tests.test_cli.TestConfigVariants.test_empty_config_file_is_reported", + "eval.tests.test_cli.TestFileContentClasses.test_file_letter_or_number_content_dispatches[accented-unicode-words]", + "eval.tests.test_cli.TestFileContentClasses.test_file_letter_or_number_content_dispatches[digits-only]", + "eval.tests.test_cli.TestFileContentClasses.test_file_letter_or_number_content_dispatches[han-chinese-words]", + "eval.tests.test_cli.TestFileContentClasses.test_file_letter_or_number_content_dispatches[letters-with-symbols]", + "eval.tests.test_cli.TestFileContentClasses.test_file_symbol_only_content_empty[dash-underscore-dot]", + "eval.tests.test_cli.TestFileContentClasses.test_file_symbol_only_content_empty[symbols-spaces]", + "eval.tests.test_cli.TestFileErrorVariants.test_empty_file_with_punctuation_flag_still_panics", + "eval.tests.test_cli.TestFileErrorVariants.test_file_path_is_directory", + "eval.tests.test_cli.TestFileMode.test_capital_flag_file", + "eval.tests.test_cli.TestFileMode.test_empty_file_panics_on_adjust_whitespace", + "eval.tests.test_cli.TestFileMode.test_file_flag_variants[long-file-flag]", + "eval.tests.test_cli.TestFileMode.test_file_flag_variants[short-file-flag]", + "eval.tests.test_cli.TestFileMode.test_min_word_length_filters_all_words", + "eval.tests.test_cli.TestFileMode.test_min_word_length_keeps_long_words", + "eval.tests.test_cli.TestFileMode.test_missing_file_errors", + "eval.tests.test_cli.TestFileMode.test_punctuation_flag_file", + "eval.tests.test_cli.TestFileMode.test_punctuation_stripped_file_empty", + "eval.tests.test_cli.TestFileMode.test_valid_file_reaches_run", + "eval.tests.test_cli.TestHelp.test_help_exits_zero_and_describes[long-help]", + "eval.tests.test_cli.TestHelp.test_help_exits_zero_and_describes[short-help]", + "eval.tests.test_cli.TestHelp.test_help_lists_capital_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_config_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_file_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_length_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_min_word_length_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_monkeytype_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_monkeytype_language_flag", + "eval.tests.test_cli.TestHelp.test_help_lists_punctuation_flag", + "eval.tests.test_cli.TestHelp.test_short_and_long_help_are_identical", + "eval.tests.test_cli.TestMinWordLengthBoundaries.test_min_word_length_2_drops_single_chars", + "eval.tests.test_cli.TestMinWordLengthBoundaries.test_min_word_length_boundaries_reach_run[minlen-0-no-filter]", + "eval.tests.test_cli.TestMinWordLengthBoundaries.test_min_word_length_boundaries_reach_run[minlen-1-no-filter]", + "eval.tests.test_cli.TestMinWordLengthBoundaries.test_min_word_length_boundaries_reach_run[minlen-2-filters-singletons]", + "eval.tests.test_cli.TestMinWordLengthStdin.test_stdin_filter_2_keeps_long_words_dispatch", + "eval.tests.test_cli.TestMinWordLengthStdin.test_stdin_filter_drops_all_words_empty", + "eval.tests.test_cli.TestRandomLength.test_non_positive_length_panics[len-neg-fifty]", + "eval.tests.test_cli.TestRandomLength.test_non_positive_length_panics[len-neg-one]", + "eval.tests.test_cli.TestRandomLength.test_non_positive_length_panics[len-zero]", + "eval.tests.test_cli.TestRandomLength.test_over_max_length_restores_and_runs[len-over-max]", + "eval.tests.test_cli.TestRandomLength.test_over_max_length_restores_and_runs[len-vastly-over-max]", + "eval.tests.test_cli.TestRandomLength.test_valid_length_reaches_run[len-1]", + "eval.tests.test_cli.TestRandomLength.test_valid_length_reaches_run[len-default-20]", + "eval.tests.test_cli.TestRandomLength.test_valid_length_reaches_run[len-max-500]", + "eval.tests.test_cli.TestRandomLength.test_zero_length_is_not_clamped_before_random_word_gen", + "eval.tests.test_cli.TestRandomLengthJustUnderMax.test_length_499_dispatches", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[accented-unicode-words]", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[collapsed-extra-spaces]", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[leading-trailing-spaces]", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[minimal-single-token]", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[single-word]", + "eval.tests.test_cli.TestStdinContentPreservation.test_content_survives_to_runner[underscore-hyphen-tokens]", + "eval.tests.test_cli.TestStdinMixedSymbolLetters.test_mixed_symbol_letter_stdin_survives[letters-dollar-mix]", + "eval.tests.test_cli.TestStdinMixedSymbolLetters.test_mixed_symbol_letter_stdin_survives[letters-double-hyphen-mix]", + "eval.tests.test_cli.TestStdinMixedSymbolLetters.test_mixed_symbol_letter_stdin_survives[letters-underscore-mix]", + "eval.tests.test_cli.TestStdinMode.test_empty_stdin_panics", + "eval.tests.test_cli.TestStdinMode.test_numeric_stdin_preserved", + "eval.tests.test_cli.TestStdinMode.test_stdin_punctuation_kept_with_flag", + "eval.tests.test_cli.TestStdinMode.test_stdin_punctuation_stripped_to_empty", + "eval.tests.test_cli.TestStdinMode.test_stdin_takes_precedence_over_file", + "eval.tests.test_cli.TestStdinMode.test_stdin_takes_precedence_over_monkeytype", + "eval.tests.test_cli.TestStdinMode.test_stdin_with_mixed_punctuation_no_flag", + "eval.tests.test_cli.TestStdinMode.test_valid_stdin_reaches_run[basic-text]", + "eval.tests.test_cli.TestStdinMode.test_valid_stdin_reaches_run[mixed-case-text]", + "eval.tests.test_cli.TestStdinMode.test_whitespace_only_stdin_empty_wordlist", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[ampersand-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[at-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[brackets-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[comma-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[dollar-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[emoji-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[hyphen-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[period-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[tilde-only]", + "eval.tests.test_cli.TestStdinSymbolOnlyEmpty.test_symbol_only_stdin_yields_empty_wordlist[underscore-only]", + "eval.tests.test_cli.TestStdinUnicodeLetters.test_unicode_letter_stdin_survives_to_runner[cyrillic]", + "eval.tests.test_cli.TestStdinUnicodeLetters.test_unicode_letter_stdin_survives_to_runner[greek]", + "eval.tests.test_cli.TestStdinUnicodeLetters.test_unicode_letter_stdin_survives_to_runner[han-chinese]", + "eval.tests.test_cli.TestWhitespaceEmptyList.test_whitespace_only_stdin_yields_empty_wordlist[single-space]", + "eval.tests.test_cli.TestWhitespaceEmptyList.test_whitespace_only_stdin_yields_empty_wordlist[space-newline-mix]", + "eval.tests.test_cli.TestWhitespaceEmptyList.test_whitespace_only_stdin_yields_empty_wordlist[spaces-tabs]", + "eval.tests.test_cli.TestWhitespaceEmptyList.test_whitespace_only_stdin_yields_empty_wordlist[tabs-only]", + "eval.tests.test_cli.TestWhitespaceNewlinePanic.test_newline_only_stdin_panics[single-crlf]", + "eval.tests.test_cli.TestWhitespaceNewlinePanic.test_newline_only_stdin_panics[single-newline]", + "eval.tests.test_cli.TestWhitespaceNewlinePanic.test_newline_only_stdin_panics[two-crlf]", + "eval.tests.test_cli.TestWhitespaceNewlinePanic.test_newline_only_stdin_panics[two-newlines]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_utility.test_adjust_length_does_not_grow_short_text", + "eval.tests.test_utility.test_adjust_length_large_length_beyond_max_clamps", + "eval.tests.test_utility.test_adjust_length_non_positive_clamps_to_default[len_neg_five]", + "eval.tests.test_utility.test_adjust_length_non_positive_clamps_to_default[len_neg_large]", + "eval.tests.test_utility.test_adjust_length_non_positive_clamps_to_default[len_neg_one]", + "eval.tests.test_utility.test_adjust_length_non_positive_clamps_to_default[len_zero]", + "eval.tests.test_utility.test_adjust_length_truncates_to_lower_word_count[len_five]", + "eval.tests.test_utility.test_adjust_length_truncates_to_lower_word_count[len_five_hundred]", + "eval.tests.test_utility.test_adjust_length_truncates_to_lower_word_count[len_one]", + "eval.tests.test_utility.test_adjust_length_truncates_to_lower_word_count[len_twenty]", + "eval.tests.test_utility.test_adjust_length_truncates_to_lower_word_count[len_two]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[blank_lines_multi_newline]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[em_spaces]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[leading_internal_trailing]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[multiple_spaces]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[multiple_tabs]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[tab_newline_mix]", + "eval.tests.test_utility.test_adjust_whitespace_collapses_to_non_empty_text[vtab_formfeed_classes]", + "eval.tests.test_utility.test_adjust_whitespace_embedded_newline_is_word_separator", + "eval.tests.test_utility.test_adjust_whitespace_empty_input_panics[crlf_newline]", + "eval.tests.test_utility.test_adjust_whitespace_empty_input_panics[empty_bytes]", + "eval.tests.test_utility.test_adjust_whitespace_empty_input_panics[four_newlines]", + "eval.tests.test_utility.test_adjust_whitespace_empty_input_panics[single_newline]", + "eval.tests.test_utility.test_adjust_whitespace_empty_input_panics[two_newlines]", + "eval.tests.test_utility.test_adjust_whitespace_strips_trailing_space", + "eval.tests.test_utility.test_adjust_whitespace_whitespace_only_becomes_empty[em_space_only]", + "eval.tests.test_utility.test_adjust_whitespace_whitespace_only_becomes_empty[space_tab_mix]", + "eval.tests.test_utility.test_adjust_whitespace_whitespace_only_becomes_empty[spaces_only]", + "eval.tests.test_utility.test_adjust_whitespace_whitespace_only_becomes_empty[tab_only]", + "eval.tests.test_utility.test_adjust_whitespace_whitespace_only_becomes_empty[vtab_formfeed_only]", + "eval.tests.test_utility.test_help_exits_zero_and_lists_flags", + "eval.tests.test_utility.test_min_word_length_all_filtered_becomes_empty[all_short_two_three]", + "eval.tests.test_utility.test_min_word_length_all_filtered_becomes_empty[all_short_vs_long_boundary]", + "eval.tests.test_utility.test_min_word_length_all_filtered_becomes_empty[all_under_ten]", + "eval.tests.test_utility.test_min_word_length_all_filtered_becomes_empty[single_rune_unicode]", + "eval.tests.test_utility.test_min_word_length_all_filtered_becomes_empty[single_short_word]", + "eval.tests.test_utility.test_min_word_length_long_words_survive[exact_four_rune_survives]", + "eval.tests.test_utility.test_min_word_length_long_words_survive[length_boundary_eq_min]", + "eval.tests.test_utility.test_min_word_length_long_words_survive[long_words_survive]", + "eval.tests.test_utility.test_min_word_length_long_words_survive[mixed_short_and_long]", + "eval.tests.test_utility.test_min_word_length_long_words_survive[unicode_short_filtered_long_survives]", + "eval.tests.test_utility.test_min_word_length_threshold_at_or_below_one_is_noop[-1-minlen_neg_one]", + "eval.tests.test_utility.test_min_word_length_threshold_at_or_below_one_is_noop[-500-minlen_neg_large]", + "eval.tests.test_utility.test_min_word_length_threshold_at_or_below_one_is_noop[0-minlen_zero]", + "eval.tests.test_utility.test_min_word_length_threshold_at_or_below_one_is_noop[1-minlen_one]", + "eval.tests.test_utility.test_min_word_length_uses_rune_count_for_unicode", + "eval.tests.test_utility.test_random_words_default_path_produces_text", + "eval.tests.test_utility.test_random_words_default_path_with_length[15]", + "eval.tests.test_utility.test_random_words_default_path_with_length[1]", + "eval.tests.test_utility.test_random_words_default_path_with_length[200]", + "eval.tests.test_utility.test_random_words_default_path_with_length[20]", + "eval.tests.test_utility.test_random_words_default_path_with_length[500]", + "eval.tests.test_utility.test_random_words_min_word_length_filters_all_bip39_words", + "eval.tests.test_utility.test_read_file_empty_file_panics", + "eval.tests.test_utility.test_read_file_missing_path_errors", + "eval.tests.test_utility.test_read_file_punctuation_only_becomes_empty", + "eval.tests.test_utility.test_read_file_valid_content_formats", + "eval.tests.test_utility.test_read_file_whitespace_only_becomes_empty", + "eval.tests.test_utility.test_read_file_with_min_word_length_filters", + "eval.tests.test_utility.test_remove_nonalpha_keeps_digits_letters", + "eval.tests.test_utility.test_remove_nonalpha_keeps_unicode_letters", + "eval.tests.test_utility.test_remove_nonalpha_kept_with_punctuation_flag", + "eval.tests.test_utility.test_remove_nonalpha_preserved_with_punctuation_flag[punct_only_dots]", + "eval.tests.test_utility.test_remove_nonalpha_preserved_with_punctuation_flag[punct_only_hashbang]", + "eval.tests.test_utility.test_remove_nonalpha_preserved_with_punctuation_flag[punct_only_multi]", + "eval.tests.test_utility.test_remove_nonalpha_punct_only_becomes_empty[punct_only_dash_underscore]", + "eval.tests.test_utility.test_remove_nonalpha_punct_only_becomes_empty[punct_only_dots]", + "eval.tests.test_utility.test_remove_nonalpha_punct_only_becomes_empty[punct_only_hashes_bangs]", + "eval.tests.test_utility.test_remove_nonalpha_punct_only_becomes_empty[punct_only_multi]", + "eval.tests.test_utility.test_remove_nonalpha_punct_only_becomes_empty[punct_only_single_bang]", + "eval.tests.test_utility.test_remove_nonalpha_removes_punctuation_between_words", + "eval.tests.test_utility.test_remove_nonalpha_removes_underscore_and_hyphen", + "eval.tests.test_utility.test_unknown_flag_is_an_error" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_format_errors.test_format_all_words_filtered_by_min_length[a b c-2]", + "eval.tests.test_format_errors.test_format_all_words_filtered_by_min_length[a bb ccc-5]", + "eval.tests.test_format_errors.test_format_all_words_filtered_by_min_length[hello tiny-10]", + "eval.tests.test_format_errors.test_format_all_words_filtered_by_min_length[tiny-6]", + "eval.tests.test_format_errors.test_format_empty_file_panics", + "eval.tests.test_format_errors.test_format_lone_newline_file_empty_result", + "eval.tests.test_format_errors.test_format_mixed_keeps_only_long_words", + "eval.tests.test_format_errors.test_format_nonexistent_file_error", + "eval.tests.test_format_errors.test_format_punctuation_only_preserved_with_flag", + "eval.tests.test_format_errors.test_format_punctuation_only_stripped_is_empty", + "eval.tests.test_format_errors.test_format_single_word_min_length_keeps", + "eval.tests.test_format_errors.test_format_whitespace_only_file_empty_result", + "eval.tests.test_format_flags.test_format_text_base_and_capital_punctuation[flags0-expected0]", + "eval.tests.test_format_flags.test_format_text_base_and_capital_punctuation[flags1-expected1]", + "eval.tests.test_format_flags.test_format_text_base_and_capital_punctuation[flags2-expected2]", + "eval.tests.test_format_flags.test_format_text_base_and_capital_punctuation[flags3-expected3]", + "eval.tests.test_format_flags.test_format_text_defaults_apply_when_flags_empty", + "eval.tests.test_format_flags.test_format_text_min_word_length[1-expected0]", + "eval.tests.test_format_flags.test_format_text_min_word_length[2-expected1]", + "eval.tests.test_format_flags.test_format_text_min_word_length[4-expected2]", + "eval.tests.test_format_flags.test_format_text_min_word_length[5-expected3]", + "eval.tests.test_format_flags.test_format_text_min_word_length[7-expected4]", + "eval.tests.test_format_flags.test_format_text_min_word_length_with_capital_and_punctuation[6-expected0]", + "eval.tests.test_format_flags.test_format_text_min_word_length_with_capital_and_punctuation[7-expected1]", + "eval.tests.test_format_flags.test_format_text_whitespace_normalized_single_spaces", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[-1-20]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[-100-20]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[-5-20]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[0-20]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[1000-500]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[501-500]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[600-500]", + "eval.tests.test_format_length.test_format_length_clamps_out_of_range[900-500]", + "eval.tests.test_format_length.test_format_length_preserves_word_order", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[1-1]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[10-10]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[19-19]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[2-2]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[20-20]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[21-21]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[499-499]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[5-5]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[50-50]", + "eval.tests.test_format_length.test_format_length_truncates_to_requested_count[500-500]", + "eval.tests.test_format_length.test_format_length_with_short_source[10-10-kappa]", + "eval.tests.test_format_length.test_format_length_with_short_source[20-20-upsilon]", + "eval.tests.test_format_length.test_format_length_with_short_source[40-34-ten]", + "eval.tests.test_format_length.test_format_length_with_short_source[500-34-ten]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_help.test_help_flag[--help]", + "eval.tests.test_cli_help.test_help_flag[-h]", + "eval.tests.test_cli_help.test_help_output_on_stdout_not_stderr", + "eval.tests.test_cli_help.test_malformed_int_flag_rejected[--length=notanint]", + "eval.tests.test_cli_help.test_malformed_int_flag_rejected[--min-word-length=abc]", + "eval.tests.test_cli_help.test_malformed_int_flag_rejected[-l=banana]", + "eval.tests.test_cli_help.test_unknown_flag_rejected[--nonsense-unknown flag: --nonsense]", + "eval.tests.test_cli_help.test_unknown_flag_rejected[--unknown-flag-unknown flag: --unknown-flag]", + "eval.tests.test_cli_help.test_unknown_flag_rejected[-q-unknown shorthand flag: 'q' in -q]", + "eval.tests.test_config_theme.test_any_readable_config_is_announced_and_runs[# only a comment]", + "eval.tests.test_config_theme.test_any_readable_config_is_announced_and_runs[::: this is not valid yaml []", + "eval.tests.test_config_theme.test_explicit_config_announced_over_default", + "eval.tests.test_config_theme.test_explicit_config_file_is_detected[foo: bar\\nbaz: 1\\n]", + "eval.tests.test_config_theme.test_explicit_config_file_is_detected[length: 0]", + "eval.tests.test_config_theme.test_explicit_config_file_is_detected[length: 10]", + "eval.tests.test_config_theme.test_explicit_config_file_is_detected[theme:\\n bar:\\n color: \"#112233\"]", + "eval.tests.test_config_theme.test_explicit_config_file_is_detected[{}]", + "eval.tests.test_config_theme.test_home_clean_config_not_announced", + "eval.tests.test_config_theme.test_missing_explicit_config_not_announced", + "eval.tests.test_stdin_formatting.test_stdin_empty_pipe_panics", + "eval.tests.test_stdin_formatting.test_stdin_empty_word_list[ ]", + "eval.tests.test_stdin_formatting.test_stdin_empty_word_list[!!!]", + "eval.tests.test_stdin_formatting.test_stdin_empty_word_list[#@#$%]", + "eval.tests.test_stdin_formatting.test_stdin_empty_word_list[\\t \\t ]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[ -args28-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[ leading whitespace-args4-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[!!!-args10-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[!!!-args16-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[!!!-args7-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[###@@-args11-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[#user @tag-args14-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[$$$$-args15-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[.,!?;:-args12-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[... -args13-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[12345-args19-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[42 is the answer-args20-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[HeLLo-args18-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[Hello, World!-args17-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[\\u041f\\u0440\\u0438\\u0432\\u0435\\u0442-args23-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[\\u2603\\u2603-args24-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[\\u4f60\\u597d\\u4e16\\u754c-args22-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[a\\u2603b-args25-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[caf\\xe9 d\\xe9j\\xe0 vu-args21-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[can't stop-args26-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[can't stop-args27-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[hello, world!-args6-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[hello-args1-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[hello...-args8-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[one two\\tthree\\n\\nfour-args3-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[the quick brown fox jumps over the lazy dog-args0-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[trailing whitespace -args5-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[well-known-args9-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_formatting_matrix[x-args2-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[alpha beta gamma delta epsilon zeta eta theta-args6-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[one two three four five-args0-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[one two three-args1-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[one two three-args2-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[one two three-args3-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[one two three-args4-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_length_truncation[w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 w31 w32 w33 w34 w35 w36 w37 w38 w39 w40 w41 w42 w43 w44 w45 w46 w47 w48 w49 w50 w51 w52 w53 w54 w55 w56 w57 w58 w59 w60 w61 w62 w63 w64 w65 w66 w67 w68 w69 w70 w71 w72 w73 w74 w75 w76 w77 w78 w79 w80 w81 w82 w83 w84 w85 w86 w87 w88 w89 w90 w91 w92 w93 w94 w95 w96 w97 w98 w99 w100 w101 w102 w103 w104 w105 w106 w107 w108 w109 w110 w111 w112 w113 w114 w115 w116 w117 w118 w119 w120 w121 w122 w123 w124 w125 w126 w127 w128 w129 w130 w131 w132 w133 w134 w135 w136 w137 w138 w139 w140 w141 w142 w143 w144 w145 w146 w147 w148 w149 w150 w151 w152 w153 w154 w155 w156 w157 w158 w159 w160 w161 w162 w163 w164 w165 w166 w167 w168 w169 w170 w171 w172 w173 w174 w175 w176 w177 w178 w179 w180 w181 w182 w183 w184 w185 w186 w187 w188 w189 w190 w191 w192 w193 w194 w195 w196 w197 w198 w199 w200 w201 w202 w203 w204 w205 w206 w207 w208 w209 w210 w211 w212 w213 w214 w215 w216 w217 w218 w219 w220 w221 w222 w223 w224 w225 w226 w227 w228 w229 w230 w231 w232 w233 w234 w235 w236 w237 w238 w239 w240 w241 w242 w243 w244 w245 w246 w247 w248 w249 w250 w251 w252 w253 w254 w255 w256 w257 w258 w259 w260 w261 w262 w263 w264 w265 w266 w267 w268 w269 w270 w271 w272 w273 w274 w275 w276 w277 w278 w279 w280 w281 w282 w283 w284 w285 w286 w287 w288 w289 w290 w291 w292 w293 w294 w295 w296 w297 w298 w299-args5-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[\\u4f60\\u597d-args6-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[a bb c-args1-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[a bb ccc-args2-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[a!!-args7-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[a-args3-word list is empty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[cat a dog bb-args0-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[hi!-args4-open /dev/tty]", + "eval.tests.test_stdin_formatting.test_stdin_min_word_length[hi!-args5-word list is empty]", + "eval.tests.test_theme_loading.test_bar_color_branches_reach_ui[theme:\\n bar:\\n color: \"\"\\n-empty-bar-color default-gradient branch]", + "eval.tests.test_theme_loading.test_bar_color_branches_reach_ui[theme:\\n bar:\\n color: \"#112233\"\\n gradient: \"#ff0000\"\\n-two-color gradient branch]", + "eval.tests.test_theme_loading.test_bar_color_branches_reach_ui[theme:\\n bar:\\n color: \"#123456\"\\n gradient: \"#654321\"\\n-bar with an alternate color and gradient]", + "eval.tests.test_theme_loading.test_bar_color_branches_reach_ui[theme:\\n bar:\\n color: \"#4776E6\"\\n-solid-fill bar branch]", + "eval.tests.test_theme_loading.test_default_theme_without_config_reaches_ui", + "eval.tests.test_theme_loading.test_nonexistent_config_path_no_theme_error", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n bar:\\n color: \"\"\\n graph:\\n color: \"cyan\"\\n-bar default gradient + graph color parsed together]", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n graph:\\n color: \"red\"\\n-graph.color parsed]", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n graph:\\n height: 5\\n-graph.height parsed]", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n text:\\n error:\\n background: \"#f33\"\\n-text.error background parsed]", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n text:\\n typed:\\n foreground: \"#fff\"\\n background: \"#000\"\\n-text.typed fg+bg parsed]", + "eval.tests.test_theme_loading.test_theme_field_parsing_reaches_ui[theme:\\n text:\\n untyped:\\n foreground: \"#555\"\\n-text.untyped foreground parsed]", + "eval.tests.test_theme_loading.test_theme_file_missing_nested_config_errors", + "eval.tests.test_theme_loading.test_theme_file_nested_config_loads", + "eval.tests.test_theme_loading.test_theme_file_self_reference_terminates" + ] + } + }, + "commit": "0e674b236154b05f89fb4f5bee20c7269fd71477", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.984977126415493, + "eval_clean_hashes": [ + "c27cc1e645d6c7a73a344a099cc86464ace2c3f144396c2cc4894f655d45ebb6" + ], + "input_record": { + "commit": "0e674b236154b05f89fb4f5bee20c7269fd71477", + "commits": 57, + "contributors": 7, + "difficulty": "easy", + "difficulty_code_lines": 690, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 690, + "difficulty_runtime_deps": 13, + "difficulty_score": 1.984977126415493, + "difficulty_test_code_lines": 0, + "full_name": "maaslalani/typer", + "github_stars": 502, + "input_joern_zip": "go_joern/maaslalani__typer.zip", + "joern_status": true, + "joern_time": 10.295256923884153, + "language": "go", + "pb_match": [ + { + "pb_fullname": "antonmedv/walk", + "rank": 237, + "similarity": 0.5233057737350464 + }, + { + "pb_fullname": "peco/peco", + "rank": 791, + "similarity": 0.4664716124534607 + }, + { + "pb_fullname": "alecthomas/chroma", + "rank": 696, + "similarity": 0.468372642993927 + }, + { + "pb_fullname": "jesseduffield/lazygit", + "rank": 927, + "similarity": 0.48456907272338867 + }, + { + "pb_fullname": "naggie/dstask", + "rank": 947, + "similarity": 0.4637177586555481 + }, + { + "pb_fullname": "noborus/ov", + "rank": 878, + "similarity": 0.4869753420352936 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 490, + "similarity": 0.5166123509407043 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 631, + "similarity": 0.4798811972141266 + }, + { + "pb_fullname": "cheat/cheat", + "rank": 921, + "similarity": 0.4836214482784271 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 487, + "similarity": 0.5048255324363708 + }, + { + "pb_fullname": "junegunn/fzf", + "rank": 697, + "similarity": 0.46247175335884094 + } + ], + "repo_age": 5.39, + "repo_path": "go/maaslalani__typer", + "source": "commit:0e674b236154b05f89fb4f5bee20c7269fd71477", + "status": "done", + "url": "https://github.com/maaslalani/typer" + }, + "instance_id": "maaslalani__typer.0e674b2", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "maaslalani/typer" +} diff --git a/maaslalani--typer.0e674b2/tests/test.sh b/maaslalani--typer.0e674b2/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/maaslalani--typer.0e674b2/tests/workspace.tar.gz b/maaslalani--typer.0e674b2/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..64ddf8a575f457778f2159ca6174b5c6a4c252b8 --- /dev/null +++ b/maaslalani--typer.0e674b2/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ce6d017d703427e1e54fff08c28e5867471e9159d8f5550b41f98103f4592af +size 2232 diff --git a/maciejczyzewski--libchaos.4412a8/environment/Dockerfile b/maciejczyzewski--libchaos.4412a8/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8a18b89b2f83c87319573607e0cc81476cee61cc --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +# programgym_quota_aware_nproc=1 +RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/maciejczyzewski--libchaos.4412a8/environment/download.sh b/maciejczyzewski--libchaos.4412a8/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f012d1b27b38b3017d764007e4f8f84dcf1d72a4 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/download.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# ProgramGym download stage for libchaos. +# +# This script is `source`-ed from the repository root during the networked +# download stage (no other repository files are present). It may only prefetch +# dependencies, prepare caches, and export environment variables that build.sh +# relies on. It must NOT compile, link, test, or otherwise build the project. +# +# libchaos (single.json selected_target = examples/file_checksum.cc) needs no +# third-party runtime or build dependency beyond the base image toolchain, which +# is already present: +# - C/C++ compiler (cc / c++) and CMake are installed in the base image. +# - The executable is linked with -static-libstdc++, which uses the static +# libstdc++.a shipped inside the same GCC/CMake toolchain, so no additomal +# library packages and no system libstdc++ runtime upgrade are required. +# +# Therefore download.sh has no downloads, no package installation, and no +# environment variables to export. It exists to be a deterministic, idempotent, +# source-safe no-op that never touches the build. + +# No-op on purpose: the build toolchain is fully provided by the base image. +# Keeping this file idempotent and side-effect free means it is always safe to +# source even if run more than once. +: diff --git a/maciejczyzewski--libchaos.4412a8/environment/executable b/maciejczyzewski--libchaos.4412a8/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..437192a450260c9f61019760d47e020def81e232 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48b7019f53ff726b99f5dce376f0e1108e30e01bec59c34430278da28dc4504e +size 2502504 diff --git a/maciejczyzewski--libchaos.4412a8/environment/harbor_prepare_download_env.sh b/maciejczyzewski--libchaos.4412a8/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/maciejczyzewski--libchaos.4412a8/environment/programgym-gcc13.tar.gz b/maciejczyzewski--libchaos.4412a8/environment/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/maciejczyzewski--libchaos.4412a8/environment/workspace.tar.gz b/maciejczyzewski--libchaos.4412a8/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6689226c33a151f2146b182983fe704c7598fcf9 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fae7cfa563f25e79cea0ba6aca691213e3469ee8b7ce70184d25da10d4fee42 +size 8793 diff --git a/maciejczyzewski--libchaos.4412a8/instruction.md b/maciejczyzewski--libchaos.4412a8/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/maciejczyzewski--libchaos.4412a8/solution/solve.sh b/maciejczyzewski--libchaos.4412a8/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/maciejczyzewski--libchaos.4412a8/task.toml b/maciejczyzewski--libchaos.4412a8/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c005f1836a6800d89a6a9e0621655e9ca9787ccc --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/maciejczyzewski--libchaos.4412a8" +description = "Synthetic ProgramGym cleanroom reconstruction task for maciejczyzewski/libchaos" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "maciejczyzewski__libchaos.4412a89" +repository = "maciejczyzewski/libchaos" +commit = "4412a894f353c6364169697b52515078760395f3" +language = "cpp" +difficulty = "medium" +difficulty_score = 2.1621759365301623 +test_branches = 6 +test_count = 2828 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/maciejczyzewski--libchaos.4412a8/tests/Dockerfile b/maciejczyzewski--libchaos.4412a8/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a1a0faf9903b95ad29f7f567bc348bee4c210a4c --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +# programgym_quota_aware_nproc=1 +RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_01.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d13a44be4194b57769d3b87d01b48ea525a16afe --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca01c15a4ded1f80b29d1488bd26e318942f395e3e755063fcbaf98f5ea7e02b +size 44732 diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_02.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ba3639b0c9e3d43ca45e2db9ae3ab26886a6c0f --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14b5be0ad5ecbae29736841bd4730545a059e49fd2c1d8bd0ac428361b6e6cd1 +size 285870 diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_03.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..24a36e183a597f452b3f6f0d704be03c54993566 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:174656a4664045edf5475f0e9d363cab9532791ef8105b163a104ec48176726d +size 41965 diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_04.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..380b47ac80bf69a492b144f1f017ccc91ecd9212 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6102437f60d8f8b6b7cdfda8880fad5a6621f8838862e78a5726ff62a63a4ca +size 88345 diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_06.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_06.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e47eb5e886a01e971744b25cd663fb3493a51a9b --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_module_06.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f639741b1baca917c71f0468266fc49d15577591140d2491b7d0a0cf580a503b +size 36851 diff --git a/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_upstream.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4326d526e99057e0d83c8430d549f7076340359a --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33150c5fa457dda8f748dcd7465c04ac1f50fe1c38bc2221cc533694717cded1 +size 9129 diff --git a/maciejczyzewski--libchaos.4412a8/tests/download.sh b/maciejczyzewski--libchaos.4412a8/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f012d1b27b38b3017d764007e4f8f84dcf1d72a4 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/download.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# ProgramGym download stage for libchaos. +# +# This script is `source`-ed from the repository root during the networked +# download stage (no other repository files are present). It may only prefetch +# dependencies, prepare caches, and export environment variables that build.sh +# relies on. It must NOT compile, link, test, or otherwise build the project. +# +# libchaos (single.json selected_target = examples/file_checksum.cc) needs no +# third-party runtime or build dependency beyond the base image toolchain, which +# is already present: +# - C/C++ compiler (cc / c++) and CMake are installed in the base image. +# - The executable is linked with -static-libstdc++, which uses the static +# libstdc++.a shipped inside the same GCC/CMake toolchain, so no additomal +# library packages and no system libstdc++ runtime upgrade are required. +# +# Therefore download.sh has no downloads, no package installation, and no +# environment variables to export. It exists to be a deterministic, idempotent, +# source-safe no-op that never touches the build. + +# No-op on purpose: the build toolchain is fully provided by the base image. +# Keeping this file idempotent and side-effect free means it is always safe to +# source even if run more than once. +: diff --git a/maciejczyzewski--libchaos.4412a8/tests/executable b/maciejczyzewski--libchaos.4412a8/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..437192a450260c9f61019760d47e020def81e232 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48b7019f53ff726b99f5dce376f0e1108e30e01bec59c34430278da28dc4504e +size 2502504 diff --git a/maciejczyzewski--libchaos.4412a8/tests/harbor_prepare_download_env.sh b/maciejczyzewski--libchaos.4412a8/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/maciejczyzewski--libchaos.4412a8/tests/programgym-gcc13.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/maciejczyzewski--libchaos.4412a8/tests/programgym_evaluator.py b/maciejczyzewski--libchaos.4412a8/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/maciejczyzewski--libchaos.4412a8/tests/programgym_task.json b/maciejczyzewski--libchaos.4412a8/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..c4ff77f240b57d63bc9da20c09fae9e48b8af8de --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/programgym_task.json @@ -0,0 +1,3026 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_checksum_golden.test_directory_argument_is_signal_aborted", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[a.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[aa.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[ab.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[ba.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[bin_nul.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[bin_nul100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[empty.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[ff255.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[fiveK.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[fourk.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[highnibble.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[lanczos.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[nl.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[onek.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[rand100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[seq1000.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[seq256.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[text_hello.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[twoK.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[ws.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[x.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[zero1.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[zero100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[zero1000.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_equals_committed_golden[zero1001.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[a.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[aa.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[ab.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[ba.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[bin_nul.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[bin_nul100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[empty.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[ff255.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[fiveK.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[fourk.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[highnibble.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[lanczos.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[nl.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[onek.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[rand100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[seq1000.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[seq256.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[text_hello.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[twoK.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[ws.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[x.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[zero1.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[zero100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[zero1000.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_has_tab_separated_15_values[zero1001.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[a.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[aa.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[ab.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[ba.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[bin_nul.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[empty.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[fourk.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[nl.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[onek.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[rand100.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[text_hello.bin]", + "eval.tests.test_checksum_golden.test_exec_real_output_values_are_unique_uint64[x.bin]", + "eval.tests.test_content_classes.test_all_ff_class_differs_from_all_zero", + "eval.tests.test_content_classes.test_all_zero_bytes_constant_class", + "eval.tests.test_content_classes.test_ascending_sequence_class", + "eval.tests.test_content_classes.test_highnibble_alternation_class", + "eval.tests.test_content_classes.test_multi_kilobyte_streams_are_stable_and_distinct", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[bin_nul100.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[ff255.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[fiveK.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[highnibble.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[lanczos.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[seq1000.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[seq256.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[twoK.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[ws.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[zero1.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[zero100.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[zero1000.bin]", + "eval.tests.test_content_classes.test_new_fixture_is_canonical_uint64[zero1001.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[bin_nul100.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[ff255.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[fiveK.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[highnibble.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[lanczos.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[seq1000.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[seq256.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[twoK.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[ws.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[zero1.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[zero100.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[zero1000.bin]", + "eval.tests.test_content_classes.test_new_fixture_matches_committed_golden[zero1001.bin]", + "eval.tests.test_content_classes.test_nul_ff_interleave_is_significant", + "eval.tests.test_content_classes.test_sequence_repetition_changes_output", + "eval.tests.test_content_classes.test_text_class_with_newlines_matches_golden", + "eval.tests.test_content_classes.test_zero_across_mask_boundary_differs", + "eval.tests.test_determinism.test_appending_a_byte_changes_checksum", + "eval.tests.test_determinism.test_deterministic_across_repeated_runs", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[a.bin-x.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[ab.bin-ba.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[bin_nul.bin-highnibble.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[empty.bin-zero1.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[ff255.bin-zero100.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[highnibble.bin-seq256.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[onek.bin-bin_nul100.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[onek.bin-seq1000.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[onek.bin-twoK.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[onek.bin-zero1000.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[seq256.bin-seq1000.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[text_hello.bin-lanczos.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[twoK.bin-fiveK.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[twoK.bin-lanczos.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[zero1.bin-a.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[zero1.bin-zero100.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[zero100.bin-zero1000.bin]", + "eval.tests.test_determinism.test_distinct_contents_yield_distinct_checksums[zero1000.bin-zero1001.bin]", + "eval.tests.test_determinism.test_identical_bytes_but_different_file_name_match", + "eval.tests.test_determinism.test_identical_contents_yield_identical_checksums", + "eval.tests.test_determinism.test_push_sequence_order_is_observable", + "eval.tests.test_determinism.test_same_bytes_via_distinct_fixture_files_match", + "eval.tests.test_determinism.test_trailing_newline_is_significant", + "eval.tests.test_io_semantics.test_directory_argument_stdout_is_empty", + "eval.tests.test_io_semantics.test_empty_regular_file_matches_committed_empty_golden", + "eval.tests.test_io_semantics.test_missing_file_silently_uses_empty_service", + "eval.tests.test_io_semantics.test_null_byte_only_file_is_processable", + "eval.tests.test_io_semantics.test_whitespace_file_is_not_all_blank_output", + "eval.tests.test_io_semantics.test_whitespace_only_file_matches_committed_golden", + "eval.tests.test_round3_large_stream.test_all_zero_sizes_are_distinct", + "eval.tests.test_round3_large_stream.test_descending_run_is_distinct_from_ascending", + "eval.tests.test_round3_large_stream.test_high_bytes_are_ordinary_data", + "eval.tests.test_round3_large_stream.test_high_bytes_changesum_differs_from_ascii_low", + "eval.tests.test_round3_large_stream.test_large_stream_big100k_is_deterministic", + "eval.tests.test_round3_large_stream.test_large_stream_keeps_five_row_layout", + "eval.tests.test_round3_large_stream.test_long_run_repetition_changes_checksum", + "eval.tests.test_round3_large_stream.test_mask_boundary_sizes_are_distinct", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[big100k.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[big10k.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[descending.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[highbytes.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[seq2000.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[textmarkdown.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[zero2000.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[zero999.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_layout_is_canonical_uint64[zeros5000.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[big100k.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[big10k.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[descending.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[highbytes.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[seq2000.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[textmarkdown.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[zero2000.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[zero999.bin]", + "eval.tests.test_round3_large_stream.test_round3_fixture_matches_committed_golden[zeros5000.bin]", + "eval.tests.test_round3_large_stream.test_text_body_with_blank_lines_matches_golden", + "eval.tests.test_round4_engine_behavior.test_all_single_byte_positions_are_distinct_in_128_byte_buffer", + "eval.tests.test_round4_engine_behavior.test_alternating_feed_matches_golden[feed0001.bin]", + "eval.tests.test_round4_engine_behavior.test_alternating_feed_matches_golden[feed01ff.bin]", + "eval.tests.test_round4_engine_behavior.test_alternating_feed_matches_golden[feed_ab7f.bin]", + "eval.tests.test_round4_engine_behavior.test_alternating_feeds_are_pairwise_distinct", + "eval.tests.test_round4_engine_behavior.test_ascending_255_matches_golden", + "eval.tests.test_round4_engine_behavior.test_ascending_64_is_distinct_from_ascending_255", + "eval.tests.test_round4_engine_behavior.test_descending_partial_differs_from_descending_full", + "eval.tests.test_round4_engine_behavior.test_each_single_byte_edge_value_is_distinct", + "eval.tests.test_round4_engine_behavior.test_fixed_prefix_last_byte_is_observable", + "eval.tests.test_round4_engine_behavior.test_four_x_vs_three_x_mask_differ", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_are_pairwise_distinct", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_match_committed_golden[half_mask_500.bin]", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_match_committed_golden[mask_plus_half_1500.bin]", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_match_committed_golden[prime1951.bin]", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_match_committed_golden[zero3000.bin]", + "eval.tests.test_round4_engine_behavior.test_mask_multiples_match_committed_golden[zero4000.bin]", + "eval.tests.test_round4_engine_behavior.test_phase_of_alternating_pair_is_observable", + "eval.tests.test_round4_engine_behavior.test_position_check_equal_across_same_offset", + "eval.tests.test_round4_engine_behavior.test_position_fixture_is_golden_exact[pos0_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_position_fixture_is_golden_exact[pos127_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_position_fixture_is_golden_exact[pos1_vff_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_position_fixture_is_golden_exact[pos63_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_position_fixture_is_golden_exact[pos64_v80_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_prime_length_differs_from_nearby_round_size", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[desc_8055.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[feed0001.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[feed01ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[feed_ab7f.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[half_mask_500.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[mask_plus_half_1500.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[one_00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[one_7f.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[one_80.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[one_ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[pos0_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[pos127_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[pos1_vff_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[pos63_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[pos64_v80_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[prime1951.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[seq_asc255.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[seq_asc64.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[tail_fix_00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[tail_fix_ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[two_7f80.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[two_eof_00ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[two_eof_ff00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[zero3000.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_is_canonical_uint64_table[zero4000.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[desc_8055.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[feed0001.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[feed01ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[feed_ab7f.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[half_mask_500.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[mask_plus_half_1500.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[one_00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[one_7f.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[one_80.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[one_ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[pos0_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[pos127_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[pos1_vff_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[pos63_v01_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[pos64_v80_zero128.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[prime1951.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[seq_asc255.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[seq_asc64.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[tail_fix_00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[tail_fix_ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[two_7f80.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[two_eof_00ff.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[two_eof_ff00.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[zero3000.bin]", + "eval.tests.test_round4_engine_behavior.test_round4_fixture_matches_committed_golden[zero4000.bin]", + "eval.tests.test_round4_engine_behavior.test_single_byte_edge_is_golden_exact[one_00.bin]", + "eval.tests.test_round4_engine_behavior.test_single_byte_edge_is_golden_exact[one_7f.bin]", + "eval.tests.test_round4_engine_behavior.test_single_byte_edge_is_golden_exact[one_80.bin]", + "eval.tests.test_round4_engine_behavior.test_single_byte_edge_is_golden_exact[one_ff.bin]", + "eval.tests.test_round4_engine_behavior.test_tail_00_is_not_an_echo_of_prefix_only", + "eval.tests.test_round4_engine_behavior.test_tail_fixture_matches_golden[tail_00]", + "eval.tests.test_round4_engine_behavior.test_tail_fixture_matches_golden[tail_ff]", + "eval.tests.test_round4_engine_behavior.test_three_x_vs_one_x_mask_differ", + "eval.tests.test_round4_engine_behavior.test_two_byte_7f80_matches_golden", + "eval.tests.test_round4_engine_behavior.test_two_byte_order_is_observable", + "eval.tests.test_round5_engine_behavior.test_aligned_and_misaligned_repeated_pattern_match_golden", + "eval.tests.test_round5_engine_behavior.test_each_uniform_value_class_is_distinct", + "eval.tests.test_round5_engine_behavior.test_interleave_pair_is_order_serial", + "eval.tests.test_round5_engine_behavior.test_misaligned_repetition_tail_is_observable", + "eval.tests.test_round5_engine_behavior.test_multiple_mask_wrap_stream_is_golden_exact[z16384]", + "eval.tests.test_round5_engine_behavior.test_multiple_mask_wrap_stream_is_golden_exact[z8192]", + "eval.tests.test_round5_engine_behavior.test_power_of_two_wrap_streams_are_distinct", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen127.bin-vs-zlen128.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen128.bin-vs-zlen129.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen15.bin-vs-zlen16.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen16.bin-vs-zlen17.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen31.bin-vs-zlen32.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen32.bin-vs-zlen33.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen63.bin-vs-zlen64.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen64.bin-vs-zlen65.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen7.bin-vs-zlen8.bin]", + "eval.tests.test_round5_engine_behavior.test_pushes_around_uint64_width_are_distinct[zlen8.bin-vs-zlen9.bin]", + "eval.tests.test_round5_engine_behavior.test_repeated_gradient_differs_from_single_ascending", + "eval.tests.test_round5_engine_behavior.test_repeated_gradient_is_long_stream_stable", + "eval.tests.test_round5_engine_behavior.test_repeated_gradient_matches_golden", + "eval.tests.test_round5_engine_behavior.test_repeated_pattern_99_matches_zero_ladder_structure", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[gradient8k.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[inter_even.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[inter_uneven.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[rep3_100.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[rep3_99.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[u01.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[u10.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[u55.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[uaa.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[uf0.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zero16384.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zero8192.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen127.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen128.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen129.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen15.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen16.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen17.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen31.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen32.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen33.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen63.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen64.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen65.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen7.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen8.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_is_canonical_uint64_table[zlen9.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[gradient8k.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[inter_even.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[inter_uneven.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[rep3_100.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[rep3_99.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[u01.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[u10.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[u55.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[uaa.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[uf0.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zero16384.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zero8192.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen127.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen128.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen129.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen15.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen16.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen17.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen31.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen32.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen33.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen63.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen64.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen65.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen7.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen8.bin]", + "eval.tests.test_round5_engine_behavior.test_round5_fixture_matches_committed_golden[zlen9.bin]", + "eval.tests.test_round5_engine_behavior.test_same_multiset_different_order_is_observable", + "eval.tests.test_round5_engine_behavior.test_uniform_value_class_is_golden_exact[u01.bin]", + "eval.tests.test_round5_engine_behavior.test_uniform_value_class_is_golden_exact[u10.bin]", + "eval.tests.test_round5_engine_behavior.test_uniform_value_class_is_golden_exact[u55.bin]", + "eval.tests.test_round5_engine_behavior.test_uniform_value_class_is_golden_exact[uaa.bin]", + "eval.tests.test_round5_engine_behavior.test_uniform_value_class_is_golden_exact[uf0.bin]", + "eval.tests.test_round5_engine_behavior.test_uniform_value_classes_differ_from_zero_and_ff", + "eval.tests.test_round5_engine_behavior.test_zero_length_growth_is_monotonic_observable", + "eval.tests.test_round6_composite_classes.test_composite_differs_from_both_constituents[c-s-z]", + "eval.tests.test_round6_composite_classes.test_composite_differs_from_both_constituents[c-u-f]", + "eval.tests.test_round6_composite_classes.test_composite_differs_from_both_constituents[c-z-f]", + "eval.tests.test_round6_composite_classes.test_composite_differs_from_both_constituents[c-z-s]", + "eval.tests.test_round6_composite_classes.test_composite_differs_from_both_constituents[c-z-u]", + "eval.tests.test_round6_composite_classes.test_every_round6_fixture_is_mutually_distinct", + "eval.tests.test_round6_composite_classes.test_pure_space_class_matches_committed_golden", + "eval.tests.test_round6_composite_classes.test_pure_space_differs_from_zero_ff_and_mixed_whitespace", + "eval.tests.test_round6_composite_classes.test_reversing_composite_blocks_changes_checksum[c-c0]", + "eval.tests.test_round6_composite_classes.test_reversing_composite_blocks_changes_checksum[c-c1]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_55aff.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_ff_zero.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_seq_zero.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_zero55.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_zero_ff.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[c_zero_seq.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_is_canonical_uint64_table[space100.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_55aff.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_ff_zero.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_seq_zero.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_zero55.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_zero_ff.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[c_zero_seq.bin]", + "eval.tests.test_round6_composite_classes.test_round6_fixture_matches_committed_golden[space100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[a.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[aa.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[ab.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[ba.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[big100k.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[big10k.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[bin_nul.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[bin_nul100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_55aff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_ff_zero.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_seq_zero.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_zero55.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_zero_ff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[c_zero_seq.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[desc_8055.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[descending.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[empty.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[feed0001.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[feed01ff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[feed_ab7f.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[ff255.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[fiveK.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[fourk.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[gradient8k.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[half_mask_500.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[highbytes.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[highnibble.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[inter_even.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[inter_uneven.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[lanczos.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[nl.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[one_00.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[one_7f.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[one_80.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[one_ff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[onek.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[prime1951.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[rand100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[rep3_100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[rep3_99.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[seq1000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[seq2000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[seq256.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[seq_asc255.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[seq_asc64.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[space100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[tail_fix_00.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[tail_fix_ff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[text_hello.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[textmarkdown.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[twoK.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[two_7f80.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[two_eof_00ff.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[two_eof_ff00.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[u01.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[u10.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[u55.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[uaa.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[uf0.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[ws.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[x.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero1.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero100.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero1000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero1001.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero16384.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero2000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero3000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero4000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero8192.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zero999.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zeros5000.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen127.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen128.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen129.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen15.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen16.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen17.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen31.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen32.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen33.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen63.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen64.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen65.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen7.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen8.bin]", + "eval.tests.test_structural.test_all_tokens_are_0x_prefixed[zlen9.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[a.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[aa.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[ab.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[ba.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[big100k.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[big10k.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[bin_nul.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[bin_nul100.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_55aff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_ff_zero.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_seq_zero.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_zero55.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_zero_ff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[c_zero_seq.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[desc_8055.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[descending.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[empty.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[feed0001.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[feed01ff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[feed_ab7f.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[ff255.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[fiveK.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[fourk.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[gradient8k.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[half_mask_500.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[highbytes.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[highnibble.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[inter_even.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[inter_uneven.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[lanczos.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[nl.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[one_00.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[one_7f.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[one_80.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[one_ff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[onek.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[prime1951.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[rand100.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[rep3_100.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[rep3_99.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[seq1000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[seq2000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[seq256.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[seq_asc255.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[seq_asc64.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[space100.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[tail_fix_00.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[tail_fix_ff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[text_hello.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[textmarkdown.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[twoK.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[two_7f80.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[two_eof_00ff.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[two_eof_ff00.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[u01.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[u10.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[u55.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[uaa.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[uf0.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[ws.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[x.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero1.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero100.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero1000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero1001.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero16384.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero2000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero3000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero4000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero8192.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zero999.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zeros5000.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen127.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen128.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen129.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen15.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen16.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen17.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen31.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen32.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen33.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen63.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen64.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen65.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen7.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen8.bin]", + "eval.tests.test_structural.test_all_tokens_parse_as_nonzero_uint64[zlen9.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[a.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[aa.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[ab.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[ba.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[big100k.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[big10k.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[bin_nul.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[bin_nul100.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_55aff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_ff_zero.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_seq_zero.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_zero55.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_zero_ff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[c_zero_seq.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[desc_8055.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[descending.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[empty.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[feed0001.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[feed01ff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[feed_ab7f.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[ff255.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[fiveK.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[fourk.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[gradient8k.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[half_mask_500.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[highbytes.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[highnibble.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[inter_even.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[inter_uneven.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[lanczos.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[nl.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[one_00.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[one_7f.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[one_80.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[one_ff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[onek.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[prime1951.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[rand100.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[rep3_100.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[rep3_99.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[seq1000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[seq2000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[seq256.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[seq_asc255.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[seq_asc64.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[space100.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[tail_fix_00.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[tail_fix_ff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[text_hello.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[textmarkdown.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[twoK.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[two_7f80.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[two_eof_00ff.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[two_eof_ff00.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[u01.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[u10.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[u55.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[uaa.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[uf0.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[ws.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[x.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero1.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero100.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero1000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero1001.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero16384.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero2000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero3000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero4000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero8192.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zero999.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zeros5000.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen127.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen128.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen129.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen15.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen16.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen17.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen31.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen32.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen33.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen63.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen64.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen65.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen7.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen8.bin]", + "eval.tests.test_structural.test_exactly_five_output_rows[zlen9.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[a.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[aa.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[ab.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[ba.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[big100k.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[big10k.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[bin_nul.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[bin_nul100.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_55aff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_ff_zero.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_seq_zero.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_zero55.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_zero_ff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[c_zero_seq.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[desc_8055.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[descending.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[empty.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[feed0001.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[feed01ff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[feed_ab7f.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[ff255.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[fiveK.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[fourk.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[gradient8k.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[half_mask_500.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[highbytes.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[highnibble.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[inter_even.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[inter_uneven.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[lanczos.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[nl.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[one_00.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[one_7f.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[one_80.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[one_ff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[onek.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[prime1951.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[rand100.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[rep3_100.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[rep3_99.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[seq1000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[seq2000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[seq256.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[seq_asc255.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[seq_asc64.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[space100.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[tail_fix_00.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[tail_fix_ff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[text_hello.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[textmarkdown.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[twoK.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[two_7f80.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[two_eof_00ff.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[two_eof_ff00.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[u01.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[u10.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[u55.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[uaa.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[uf0.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[ws.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[x.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero1.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero100.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero1000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero1001.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero16384.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero2000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero3000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero4000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero8192.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zero999.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zeros5000.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen127.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen128.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen129.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen15.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen16.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen17.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen31.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen32.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen33.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen63.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen64.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen65.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen7.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen8.bin]", + "eval.tests.test_structural.test_exactly_three_tokens_per_row[zlen9.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[a.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[aa.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[ab.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[ba.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[big100k.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[big10k.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[bin_nul.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[bin_nul100.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_55aff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_ff_zero.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_seq_zero.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_zero55.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_zero_ff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[c_zero_seq.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[desc_8055.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[descending.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[empty.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[feed0001.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[feed01ff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[feed_ab7f.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[ff255.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[fiveK.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[fourk.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[gradient8k.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[half_mask_500.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[highbytes.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[highnibble.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[inter_even.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[inter_uneven.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[lanczos.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[nl.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[one_00.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[one_7f.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[one_80.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[one_ff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[onek.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[prime1951.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[rand100.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[rep3_100.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[rep3_99.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[seq1000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[seq2000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[seq256.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[seq_asc255.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[seq_asc64.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[space100.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[tail_fix_00.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[tail_fix_ff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[text_hello.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[textmarkdown.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[twoK.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[two_7f80.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[two_eof_00ff.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[two_eof_ff00.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[u01.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[u10.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[u55.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[uaa.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[uf0.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[ws.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[x.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero1.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero100.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero1000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero1001.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero16384.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero2000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero3000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero4000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero8192.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zero999.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zeros5000.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen127.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen128.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen129.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen15.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen16.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen17.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen31.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen32.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen33.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen63.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen64.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen65.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen7.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen8.bin]", + "eval.tests.test_structural.test_hex_bodies_are_valid_trimmed_uint64[zlen9.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[a.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[aa.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[ab.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[ba.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[big100k.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[big10k.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[bin_nul.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[bin_nul100.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_55aff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_ff_zero.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_seq_zero.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_zero55.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_zero_ff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[c_zero_seq.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[desc_8055.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[descending.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[empty.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[feed0001.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[feed01ff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[feed_ab7f.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[ff255.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[fiveK.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[fourk.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[gradient8k.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[half_mask_500.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[highbytes.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[highnibble.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[inter_even.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[inter_uneven.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[lanczos.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[mask_plus_half_1500.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[nl.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[one_00.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[one_7f.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[one_80.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[one_ff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[onek.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[pos0_v01_zero128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[pos127_v01_zero128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[pos1_vff_zero128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[pos63_v01_zero128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[pos64_v80_zero128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[prime1951.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[rand100.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[rep3_100.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[rep3_99.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[seq1000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[seq2000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[seq256.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[seq_asc255.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[seq_asc64.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[space100.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[tail_fix_00.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[tail_fix_ff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[text_hello.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[textmarkdown.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[twoK.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[two_7f80.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[two_eof_00ff.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[two_eof_ff00.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[u01.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[u10.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[u55.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[uaa.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[uf0.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[ws.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[x.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero1.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero100.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero1000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero1001.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero16384.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero2000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero3000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero4000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero8192.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zero999.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zeros5000.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen127.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen128.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen129.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen15.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen16.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen17.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen31.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen32.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen33.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen63.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen64.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen65.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen7.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen8.bin]", + "eval.tests.test_structural.test_run_is_byte_stable_across_two_invocations[zlen9.bin]", + "eval.tests.test_usage.test_empty_string_argument_silently_treated_as_empty_file", + "eval.tests.test_usage.test_extra_arguments_ignored", + "eval.tests.test_usage.test_no_args_prints_usage_and_exits_nonzero", + "eval.tests.test_usage.test_no_args_usage_goes_to_stdout_only", + "eval.tests.test_usage.test_no_args_usage_has_single_short_line", + "eval.tests.test_usage.test_no_args_usage_reflects_invoked_program_name", + "eval.tests.test_usage.test_single_dash_argument_is_a_real_pathname" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_arguments.test_directory_argument_aborts", + "eval.tests.test_arguments.test_empty_string_filename_like_missing", + "eval.tests.test_arguments.test_extra_arguments_ignored", + "eval.tests.test_arguments.test_missing_file_equals_empty_checksum", + "eval.tests.test_arguments.test_no_argument_prints_usage_and_exits_nonzero", + "eval.tests.test_arguments.test_nonexistent_dir_arg_equals_empty", + "eval.tests.test_arguments.test_usage_goes_to_stdout_not_stderr", + "eval.tests.test_arguments.test_usage_message_exact", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[55]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[aa]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[aa_ff]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[alt_01]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[alt_ff00]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[be16_0to999]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[be32_0to499]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_ab]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_abc]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_ac]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_acb]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_ba]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_bac]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_bca]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_ca_]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_cab]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[concat_cba]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[dispread]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_001]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_002]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_003]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_004]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_005]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_006]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_007]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_008]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_009]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_010]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_011]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_012]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_013]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_014]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_015]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_016]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_017]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_018]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_019]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_020]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_021]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_022]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_023]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_024]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_025]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_026]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_027]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_028]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_029]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_030]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_031]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_032]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_033]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_034]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_035]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_036]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_037]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_038]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_039]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_040]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_041]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_042]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_043]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_044]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_045]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_046]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_047]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_048]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[doc_field_049]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[inc8]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_001]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_002]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_003]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_004]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_005]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_006]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_007]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_008]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0097]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_009]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_010]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_011]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0128]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_012]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_013]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_014]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_015]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_016]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_017]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_018]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_019]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_020]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_021]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_022]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_023]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_024]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0256]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_025]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_026]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_027]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_028]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_029]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_030]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_031]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_032]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_033]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_034]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_035]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_036]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_037]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_038]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_039]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_040]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_041]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_042]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_043]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_044]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_045]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_046]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_047]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_048]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_049]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_050]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0511]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0512]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_051]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_052]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_053]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_054]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_055]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_056]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_057]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_058]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_059]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_060]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_061]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_062]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_063]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_064]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0984]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0985]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0986]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_0999]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1001]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1002]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1023]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1024]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1500]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1900]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1969]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1970]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1971]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_1999]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_2000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_2001]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_2015]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_2048]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_3000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_4096]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_5000]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[klen_8192]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[le16_0to999]", + "eval.tests.test_golden_boundaries.test_exact_boundary_checksum[le32_0to499]", + "eval.tests.test_golden_boundaries.test_keystream_length_boundary_advances", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[alpha_sweep]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[alt_01_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[alt_01_16]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[alt_ff00_200]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[alt_ff00_30]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_00]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_01]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_02]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_03]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_04]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_05]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_06]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_07]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_08]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_09]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_0f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_10]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_11]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_12]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_13]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_14]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_15]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_16]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_17]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_18]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_19]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_1f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_20]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_21]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_22]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_23]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_24]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_25]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_26]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_27]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_28]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_29]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_2f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_30]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_31]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_32]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_33]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_34]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_35]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_36]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_37]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_38]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_39]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_3f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_40]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_41]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_42]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_43]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_44]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_45]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_46]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_47]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_48]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_49]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_4f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_50]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_51]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_52]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_53]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_54]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_55]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_56]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_57]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_58]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_59]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_5f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_60]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_61]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_62]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_63]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_64]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_65]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_66]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_67]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_68]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_69]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_6f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_70]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_71]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_72]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_73]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_74]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_75]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_76]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_77]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_78]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_79]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_7f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_80]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_81]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_82]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_83]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_84]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_85]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_86]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_87]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_88]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_89]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_8f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_90]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_91]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_92]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_93]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_94]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_95]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_96]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_97]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_98]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_99]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9a]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9e]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_9f]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_a9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_aa]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ab]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ac]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ad]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ae]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_af]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_b9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ba]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_bb]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_bc]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_bd]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_be]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_bf]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_c9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ca]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_cb]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_cc]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_cd]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ce]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_cf]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_d9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_da]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_db]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_dc]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_dd]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_de]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_df]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_e9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ea]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_eb]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ec]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ed]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ee]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ef]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f1]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f4]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f6]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f8]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_f9]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_fa]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_fb]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_fc]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_fd]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_fe]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[byte_ff]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_dn_1000]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_dn_16]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_dn_250]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_up_16]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_up_255]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_up_31]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[count_up_5]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[ff_00_alt]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[ff_00_toggle]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[fox_sentence]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[high_f7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[high_high]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0003]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0004]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0005]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0006]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0008]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0009]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0010]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0011]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0012]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0013]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0017]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0018]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0019]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0020]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0021]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0022]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0023]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0024]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0025]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0026]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0027]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0028]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0029]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0030]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0032]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0033]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0034]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0035]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0036]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0037]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0038]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0039]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0040]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0041]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0042]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0043]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0044]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0045]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0046]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0047]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0048]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0049]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0050]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0051]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0052]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0053]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0054]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0055]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0056]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0057]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0058]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0059]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len0_0060]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0002]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0003]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0004]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0005]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0006]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0008]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0009]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0010]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0011]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0012]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0013]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0014]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0015]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0016]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0017]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0018]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0019]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0020]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0021]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0022]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0023]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0024]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0025]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0026]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenF_0027]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0061]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0062]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0063]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0064]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0065]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0066]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0067]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0068]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0069]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0070]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0071]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0072]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0073]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0074]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0075]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0076]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0077]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0078]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0079]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0080]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0081]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0082]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0083]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0084]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0085]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0086]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0087]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0088]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0089]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0090]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0091]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0092]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0093]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0094]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0095]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0097]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0098]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0099]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0101]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0102]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0103]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0104]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0105]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0106]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0107]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0108]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0109]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0110]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0111]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0112]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0113]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0114]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0115]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0116]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0117]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0118]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0119]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0120]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0121]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0122]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0123]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0124]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0125]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0126]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0127]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0128]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0129]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0130]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0131]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0132]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0133]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0134]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0135]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0136]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0137]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0138]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0139]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0140]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0141]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0142]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0143]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0144]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0145]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0146]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0147]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0148]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0149]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[lenZ_0150]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_002]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_003]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_004]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_005]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_006]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_007]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_008]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_009]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_010]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_011]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_012]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_013]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_014]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_015]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_016]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_017]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_018]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_019]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_020]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_021]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_022]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_023]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_024]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_025]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_026]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_027]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_028]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_029]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_030]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_031]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_032]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_033]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_034]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_035]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_036]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_037]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_038]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_039]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_040]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_041]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_042]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_043]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_044]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_045]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_046]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_047]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_048]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_049]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_050]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_051]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_052]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_053]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_054]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_055]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_056]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_057]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_058]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_059]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_Z_060]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_1001]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_14]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_16]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_255]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_256]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_2]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_31]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_500]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[len_null_999]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[mixed_words]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[multiline_3]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rand_1000]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rand_65536]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rand_8192]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_A_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_A_4096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_A_7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_f_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_f_4096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_f_7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_h_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_h_4096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_h_7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_one_100]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_one_4096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_one_7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_z_4096]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[rep_z_7]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[seq_0_255]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[seq_0_63]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[text_b]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[text_c]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[text_d]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[utf8_partial]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[zero_0]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[zero_1000]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[zero_15]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[zero_2000]", + "eval.tests.test_golden_keystream.test_exact_golden_checksum[zero_64]", + "eval.tests.test_golden_keystream.test_golden_self_check_from_file", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_AABBC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABCCD]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABCDE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABCD]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABCED]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABDC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ABDEC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ACBDE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ACBD]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ACBED]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ACDB]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ADBC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_ADCB]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_BACDE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_BCADE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_BCBAD]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_CABDE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_CBADE]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_DEABC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_EDCAB]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_EDCBA]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[blk4_EEABC]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_008]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_032]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_048]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_096]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64be_256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_008]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_032]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_048]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_096]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[cntr64le_256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le2_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le2_0128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le2_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le2_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le2_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le_0128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[f64le_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_1001]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_1014]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradd_1024]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_1001]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_1014]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[gradn_1024]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist1_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist3_0256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist3_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist3_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist3_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[hist3_1024]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[inc255_0255]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[inc255_0256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[inc255_0510]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[inc255_0900]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_00ff_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_00ff_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_00ff_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_00ff_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_7e_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_7e_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_7e_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_7e_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_ab_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_ab_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_ab_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pat_ab_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper11_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper11_0500]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper11_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper11_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper13_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper13_0500]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper13_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper13_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper15_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper15_0500]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper15_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper15_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper5_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper5_0500]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper5_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper5_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper7_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper7_0500]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper7_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pper7_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_0128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_0256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo42_1024]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_0128]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_0256]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_0512]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[pseudo7_1024]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep00_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep01_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep0f_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep3c_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep7f_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[rep80_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repfe_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0064]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0400]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0984]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0986]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_0999]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_1000]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_1015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[repff_1016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0015]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0016]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0030]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0045]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0060]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0075]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0090]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0900]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[res15_0990]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[utf8_0100]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[utf8_0985]", + "eval.tests.test_golden_round4.test_exact_round4_checksum[utf8_1000]", + "eval.tests.test_golden_round4.test_round4_counter_families_distinct_and_stable", + "eval.tests.test_golden_round4.test_round4_repeated_byte_boundaries_pairwise_distinct", + "eval.tests.test_structure.test_all_tokens_are_hex_words", + "eval.tests.test_structure.test_append_sequence_moves_stream", + "eval.tests.test_structure.test_append_shifts_state", + "eval.tests.test_structure.test_determinism_same_input_same_output", + "eval.tests.test_structure.test_key_space_boundary_runs_cleanly", + "eval.tests.test_structure.test_length_zero_vs_single_null", + "eval.tests.test_structure.test_no_output_on_stderr_for_valid_file", + "eval.tests.test_structure.test_output_ends_with_newline", + "eval.tests.test_structure.test_output_shape_five_rows_three_columns", + "eval.tests.test_structure.test_pairwise_distinctness_subset", + "eval.tests.test_structure.test_single_byte_content_sensitivity" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_errors" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_arguments.test_dash_h_is_a_filename", + "eval.tests.test_arguments.test_dot_path_yields_nonempty_directory_accounting", + "eval.tests.test_arguments.test_empty_string_filename_yields_empty_checksum", + "eval.tests.test_arguments.test_extra_arguments_are_ignored", + "eval.tests.test_arguments.test_flags_are_not_parsed_help_is_a_filename", + "eval.tests.test_arguments.test_help_flag_with_real_file_uses_file", + "eval.tests.test_arguments.test_many_extra_arguments_are_ignored", + "eval.tests.test_arguments.test_no_arguments_it_is_single_usage_line", + "eval.tests.test_arguments.test_no_arguments_prints_usage_and_exits_1", + "eval.tests.test_arguments.test_no_arguments_usage_goes_to_stdout_not_stderr", + "eval.tests.test_arguments.test_no_arguments_usage_names_filename_token", + "eval.tests.test_arguments.test_nonexistent_file_yields_empty_stream_checksum", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[1000]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[1001]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[1023]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[1024]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[1025]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[2047]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[2048]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[2049]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[255]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[256]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[257]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[511]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[512]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[513]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_exact_golden[999]", + "eval.tests.test_block_boundary_goldens.test_block_boundary_goldens_are_pairwise_distinct", + "eval.tests.test_block_swap_registers.test_all_block_swaps_are_pairwise_distinct", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[0_256]", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[0_512]", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[100_700]", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[128_384]", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[33_700]", + "eval.tests.test_block_swap_registers.test_block_swap_differs_from_base[512_768]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[0_256]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[0_512]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[100_700]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[128_384]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[33_700]", + "eval.tests.test_block_swap_registers.test_block_swap_exact_golden[512_768]", + "eval.tests.test_content_state.test_content_longer_than_stream_wide", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[all_zero_vs_all_one]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[append_changes]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[ascii_boundary]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[ascii_lower_upper_case]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[byte_255_vs_256]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[byte_order_matters]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[case_matters]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[dash_vs_underscore]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[digit_vs_letter]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[double_vs_single_space]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[embedded_space]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[empty_vs_one_byte]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[evens_vs_odds]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[ff_repeat_vs_alt]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[leading_vs_no_leading_nul]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[leading_whitespace]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[length_64_vs_65]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[longer_prefix]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[newline_count]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[nibble_border]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[one_kb_vs_one_kb_plus]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[one_vs_two_bytes]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[prefix_vs_suffix]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[reverse_col]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[shift_in_middle]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[single_differing_byte]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[tab_vs_space]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[trailing_newline]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[two_chars_swapped]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[upper_prefix]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[utf8_injection]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[windows_vs_unix]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[zero_vs_one_byte_alt]", + "eval.tests.test_content_state.test_distinct_inputs_produce_distinct_outputs[zero_vs_one_null]", + "eval.tests.test_content_state.test_identical_content_identical_output[a]", + "eval.tests.test_content_state.test_identical_content_identical_output[ab]", + "eval.tests.test_content_state.test_identical_content_identical_output[abc]", + "eval.tests.test_content_state.test_identical_content_identical_output[hello]", + "eval.tests.test_content_state.test_max_length_no_trailing_newline", + "eval.tests.test_content_state.test_output_depends_on_every_byte_prefix_increment", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[a]", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[empty]", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[hello]", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[nulls4k]", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[range]", + "eval.tests.test_content_state.test_repeated_invocation_deterministic[x100k]", + "eval.tests.test_content_state.test_very_large_input_two_mib", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[abcd_repeat]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[hex_ascii32]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[lower19]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_128]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_16]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_256]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_63]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_64]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[null_65]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[ones_16]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[ones_64]", + "eval.tests.test_content_vectors.test_content_vector_exact_golden[two_newlines]", + "eval.tests.test_cycle_permutation_goldens.test_cycle_permutation_exact_golden[perm_256]", + "eval.tests.test_cycle_permutation_goldens.test_cycle_permutation_exact_golden[perm_512]", + "eval.tests.test_cycle_permutation_goldens.test_cycle_permutation_exact_golden[perm_deranged_256]", + "eval.tests.test_cycle_permutation_goldens.test_cycle_permutation_exact_golden[perm_deranged_512]", + "eval.tests.test_cycle_permutation_goldens.test_permutation_differs_from_unordered_range[perm_256]", + "eval.tests.test_cycle_permutation_goldens.test_permutation_differs_from_unordered_range[perm_512]", + "eval.tests.test_cycle_permutation_goldens.test_permutation_differs_from_unordered_range[perm_deranged_256]", + "eval.tests.test_cycle_permutation_goldens.test_permutation_differs_from_unordered_range[perm_deranged_512]", + "eval.tests.test_cycle_permutation_goldens.test_permutations_are_pairwise_distinct", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[1023]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[127]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[1]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[200]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[333]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[511]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[63]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[700]", + "eval.tests.test_deep_position_flips.test_deep_flip_differs_from_base[888]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[1023]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[127]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[1]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[200]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[333]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[511]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[63]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[700]", + "eval.tests.test_deep_position_flips.test_deep_flip_exact_golden[888]", + "eval.tests.test_deep_position_flips.test_deep_flips_are_pairwise_distinct", + "eval.tests.test_errors.test_directory_argument_exits_nonzero", + "eval.tests.test_errors.test_directory_argument_reports_ios_failure_on_stderr", + "eval.tests.test_errors.test_directory_argument_terminal_failure", + "eval.tests.test_errors.test_directory_under_cwd", + "eval.tests.test_errors.test_empty_file_is_empty_checksum", + "eval.tests.test_errors.test_empty_filename_is_empty_checksum_not_error", + "eval.tests.test_errors.test_fifo_input_is_read", + "eval.tests.test_errors.test_missing_file_is_not_a_failure", + "eval.tests.test_errors.test_one_null_byte_is_not_empty", + "eval.tests.test_errors.test_unreadable_file_failure", + "eval.tests.test_fifo_large_stream.test_fifo_gapped_large_equals_regular_file", + "eval.tests.test_golden_checksums.test_golden_checksum[ab]", + "eval.tests.test_golden_checksums.test_golden_checksum[all_ascii_printable]", + "eval.tests.test_golden_checksums.test_golden_checksum[ascii_32_126]", + "eval.tests.test_golden_checksums.test_golden_checksum[crlf]", + "eval.tests.test_golden_checksums.test_golden_checksum[digits_10k]", + "eval.tests.test_golden_checksums.test_golden_checksum[empty]", + "eval.tests.test_golden_checksums.test_golden_checksum[ff64]", + "eval.tests.test_golden_checksums.test_golden_checksum[four_nulls]", + "eval.tests.test_golden_checksums.test_golden_checksum[fox]", + "eval.tests.test_golden_checksums.test_golden_checksum[full_range]", + "eval.tests.test_golden_checksums.test_golden_checksum[hello]", + "eval.tests.test_golden_checksums.test_golden_checksum[high_bit]", + "eval.tests.test_golden_checksums.test_golden_checksum[letter_z]", + "eval.tests.test_golden_checksums.test_golden_checksum[letter_zz]", + "eval.tests.test_golden_checksums.test_golden_checksum[newline_many]", + "eval.tests.test_golden_checksums.test_golden_checksum[nl_only]", + "eval.tests.test_golden_checksums.test_golden_checksum[one_kb_zeros]", + "eval.tests.test_golden_checksums.test_golden_checksum[one_null]", + "eval.tests.test_golden_checksums.test_golden_checksum[reverse_range]", + "eval.tests.test_golden_checksums.test_golden_checksum[single_a]", + "eval.tests.test_golden_checksums.test_golden_checksum[single_space]", + "eval.tests.test_golden_checksums.test_golden_checksum[spaces_100]", + "eval.tests.test_golden_checksums.test_golden_checksum[tab]", + "eval.tests.test_golden_checksums.test_golden_checksum[two_kb_pattern]", + "eval.tests.test_golden_checksums.test_golden_checksum[upcase]", + "eval.tests.test_golden_checksums.test_golden_checksum[utf8]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[ab]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[all_ascii_printable]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[ascii_32_126]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[crlf]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[digits_10k]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[empty]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[ff64]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[four_nulls]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[fox]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[full_range]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[hello]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[high_bit]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[letter_z]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[letter_zz]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[newline_many]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[nl_only]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[one_kb_zeros]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[one_null]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[reverse_range]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[single_a]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[single_space]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[spaces_100]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[tab]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[two_kb_pattern]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[upcase]", + "eval.tests.test_golden_checksums.test_golden_is_stable_across_repeats[utf8]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_boundary_exact_golden[1000]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_boundary_exact_golden[1024]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_boundary_exact_golden[2048]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_boundary_exact_golden[256]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_boundary_exact_golden[512]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_lengths_are_mutually_distinct[1000]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_lengths_are_mutually_distinct[1024]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_lengths_are_mutually_distinct[2048]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_lengths_are_mutually_distinct[256]", + "eval.tests.test_high_entropy_boundaries.test_high_entropy_lengths_are_mutually_distinct[512]", + "eval.tests.test_link_paths.test_broken_symlink_is_empty_stream", + "eval.tests.test_link_paths.test_dot_slash_prefix_matches_plain", + "eval.tests.test_link_paths.test_filename_with_spaces_round_trips", + "eval.tests.test_link_paths.test_hardlink_same_checksum_as_target", + "eval.tests.test_link_paths.test_relative_path_matches_absolute", + "eval.tests.test_link_paths.test_symlink_chain_resolves_to_target", + "eval.tests.test_link_paths.test_symlink_to_directory_aborts", + "eval.tests.test_link_paths.test_symlink_to_file_same_checksum", + "eval.tests.test_link_paths.test_unicode_filename_readable", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[0]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[127]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[255]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[499]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[500]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_differs_from_base_and_others[999]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[0]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[127]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[255]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[499]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[500]", + "eval.tests.test_offset_flip_goldens.test_offset_flip_exact_golden[999]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[ab]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[digits-10k]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[empty]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[ff64]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[four-nulls]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[fox]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[full-range]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[hello]", + "eval.tests.test_output_format.test_all_fifteen_tokens_distinct[single_a]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[ab]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[digits-10k]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[empty]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[ff64]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[four-nulls]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[fox]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[full-range]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[hello]", + "eval.tests.test_output_format.test_every_token_is_lowercase_hex[single_a]", + "eval.tests.test_output_format.test_format_rows_columns[ab]", + "eval.tests.test_output_format.test_format_rows_columns[digits-10k]", + "eval.tests.test_output_format.test_format_rows_columns[empty]", + "eval.tests.test_output_format.test_format_rows_columns[ff64]", + "eval.tests.test_output_format.test_format_rows_columns[four-nulls]", + "eval.tests.test_output_format.test_format_rows_columns[fox]", + "eval.tests.test_output_format.test_format_rows_columns[full-range]", + "eval.tests.test_output_format.test_format_rows_columns[hello]", + "eval.tests.test_output_format.test_format_rows_columns[single_a]", + "eval.tests.test_output_format.test_output_ends_with_newline[ab]", + "eval.tests.test_output_format.test_output_ends_with_newline[digits-10k]", + "eval.tests.test_output_format.test_output_ends_with_newline[empty]", + "eval.tests.test_output_format.test_output_ends_with_newline[ff64]", + "eval.tests.test_output_format.test_output_ends_with_newline[four-nulls]", + "eval.tests.test_output_format.test_output_ends_with_newline[fox]", + "eval.tests.test_output_format.test_output_ends_with_newline[full-range]", + "eval.tests.test_output_format.test_output_ends_with_newline[hello]", + "eval.tests.test_output_format.test_output_ends_with_newline[single_a]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[ab]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[digits-10k]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[empty]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[ff64]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[four-nulls]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[fox]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[full-range]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[hello]", + "eval.tests.test_output_format.test_tokens_are_tab_separated[single_a]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[0]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[100]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[101]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[102]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[103]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[104]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[105]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[106]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[107]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[108]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[109]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[10]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[110]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[111]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[112]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[113]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[114]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[115]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[116]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[117]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[118]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[119]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[11]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[120]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[121]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[122]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[123]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[124]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[125]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[126]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[127]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[128]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[129]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[12]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[130]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[131]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[132]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[133]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[134]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[135]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[136]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[137]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[138]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[139]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[13]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[140]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[141]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[142]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[143]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[144]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[145]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[146]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[147]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[148]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[149]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[14]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[150]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[151]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[152]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[153]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[154]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[155]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[156]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[157]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[158]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[159]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[15]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[160]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[161]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[162]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[163]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[164]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[165]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[166]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[167]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[168]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[169]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[16]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[170]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[171]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[172]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[173]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[174]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[175]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[176]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[177]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[178]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[179]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[17]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[180]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[181]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[182]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[183]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[184]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[185]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[186]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[187]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[188]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[189]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[18]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[190]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[191]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[192]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[193]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[194]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[195]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[196]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[197]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[198]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[199]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[19]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[1]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[200]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[201]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[202]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[203]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[204]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[205]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[206]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[207]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[208]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[209]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[20]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[210]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[211]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[212]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[213]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[214]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[215]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[216]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[217]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[218]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[219]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[21]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[220]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[221]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[222]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[223]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[224]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[225]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[226]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[227]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[228]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[229]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[22]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[230]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[231]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[232]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[233]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[234]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[235]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[236]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[237]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[238]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[239]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[23]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[240]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[241]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[242]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[243]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[244]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[245]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[246]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[247]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[248]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[249]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[24]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[250]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[251]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[252]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[253]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[254]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[255]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[25]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[26]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[27]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[28]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[29]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[2]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[30]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[31]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[32]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[33]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[34]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[35]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[36]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[37]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[38]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[39]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[3]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[40]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[41]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[42]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[43]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[44]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[45]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[46]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[47]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[48]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[49]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[4]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[50]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[51]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[52]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[53]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[54]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[55]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[56]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[57]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[58]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[59]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[5]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[60]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[61]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[62]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[63]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[64]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[65]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[66]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[67]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[68]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[69]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[6]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[70]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[71]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[72]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[73]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[74]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[75]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[76]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[77]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[78]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[79]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[7]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[80]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[81]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[82]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[83]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[84]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[85]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[86]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[87]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[88]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[89]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[8]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[90]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[91]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[92]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[93]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[94]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[95]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[96]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[97]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[98]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[99]", + "eval.tests.test_single_byte_goldens.test_single_byte_exact_golden[9]", + "eval.tests.test_special_path_args.test_all_empty_stream_sources_collapse_to_one_golden", + "eval.tests.test_special_path_args.test_dash_ignores_stdin_and_is_empty_stream[newline-only]", + "eval.tests.test_special_path_args.test_dash_ignores_stdin_and_is_empty_stream[nul-content]", + "eval.tests.test_special_path_args.test_dash_ignores_stdin_and_is_empty_stream[text-content]", + "eval.tests.test_special_path_args.test_dash_without_stdin_is_empty_stream", + "eval.tests.test_special_path_args.test_dev_null_character_device_is_empty_stream", + "eval.tests.test_special_path_args.test_redundant_separator_normalizes_to_canonical[dot-segment]", + "eval.tests.test_special_path_args.test_redundant_separator_normalizes_to_canonical[double-slash]", + "eval.tests.test_token_format_precision.test_each_line_has_exactly_two_tabs[control-whitespace]", + "eval.tests.test_token_format_precision.test_each_line_has_exactly_two_tabs[empty]", + "eval.tests.test_token_format_precision.test_each_line_has_exactly_two_tabs[ff64]", + "eval.tests.test_token_format_precision.test_each_line_has_exactly_two_tabs[mixed-bytes]", + "eval.tests.test_token_format_precision.test_no_token_is_bare_or_upper[control-whitespace]", + "eval.tests.test_token_format_precision.test_no_token_is_bare_or_upper[empty]", + "eval.tests.test_token_format_precision.test_no_token_is_bare_or_upper[ff64]", + "eval.tests.test_token_format_precision.test_no_token_is_bare_or_upper[mixed-bytes]", + "eval.tests.test_token_format_precision.test_output_contains_only_hex_tab_newline[control-whitespace]", + "eval.tests.test_token_format_precision.test_output_contains_only_hex_tab_newline[empty]", + "eval.tests.test_token_format_precision.test_output_contains_only_hex_tab_newline[ff64]", + "eval.tests.test_token_format_precision.test_output_contains_only_hex_tab_newline[mixed-bytes]", + "eval.tests.test_token_format_precision.test_output_has_no_spaces_and_no_blank_line[control-whitespace]", + "eval.tests.test_token_format_precision.test_output_has_no_spaces_and_no_blank_line[empty]", + "eval.tests.test_token_format_precision.test_output_has_no_spaces_and_no_blank_line[ff64]", + "eval.tests.test_token_format_precision.test_output_has_no_spaces_and_no_blank_line[mixed-bytes]", + "eval.tests.test_trailing_slash_paths.test_empty_file_and_trailing_slash_file_agree", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_is_not_plain_file[full-range]", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_is_not_plain_file[short-text]", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_is_not_plain_file[single-nul]", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_on_file_is_empty_stream[full-range]", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_on_file_is_empty_stream[short-text]", + "eval.tests.test_trailing_slash_paths.test_trailing_slash_on_file_is_empty_stream[single-nul]" + ] + }, + "generated_module_06": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_position_length_sensitivity.test_all_position_flips_mutually_distinct", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_position_length_sensitivity.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_public_surface.test_boundary_payloads_are_pairwise_distinct", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_public_surface.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_scale_multi_block.test_scale_pairwise_distinct_by_size", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_scale_multi_block.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_arg_precedence.test_dash_argv1_with_surplus_falls_to_empty", + "eval.tests.test_arg_precedence.test_directory_argv1_aborts_despite_valid_argv2[nested]", + "eval.tests.test_arg_precedence.test_directory_argv1_aborts_despite_valid_argv2[plain]", + "eval.tests.test_arg_precedence.test_directory_argv1_aborts_despite_valid_argv2[trailing_slash]", + "eval.tests.test_arg_precedence.test_missing_or_empty_argv1_yields_empty_golden_not_argv2[]", + "eval.tests.test_arg_precedence.test_missing_or_empty_argv1_yields_empty_golden_not_argv2[missing_no_fallback]", + "eval.tests.test_arg_precedence.test_valid_argv1_with_surplus_uses_only_argv1", + "eval.tests.test_args.test_dot_and_double_dot_relative", + "eval.tests.test_args.test_extra_positional_args_ignored", + "eval.tests.test_args.test_filename_with_spaces", + "eval.tests.test_args.test_long_filename_is_readable", + "eval.tests.test_args.test_relative_path_matches_absolute", + "eval.tests.test_args.test_three_args_first_wins", + "eval.tests.test_byte_range.test_byte_0x00_distinct_from_text", + "eval.tests.test_byte_range.test_byte_order_noncommutative", + "eval.tests.test_byte_range.test_cumulative_prefix_distinct_exe", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[127]", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[129]", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[254]", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[2]", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[31]", + "eval.tests.test_byte_range.test_edge_bytes_not_colliding_with_neighbors[32]", + "eval.tests.test_byte_range.test_entire_byte_range_pairwise_distinct", + "eval.tests.test_charclass_goldens.test_adjacent_charclasses_differ[CTRL-HIGHBIT]", + "eval.tests.test_charclass_goldens.test_adjacent_charclasses_differ[SP16-SP64]", + "eval.tests.test_charclass_goldens.test_adjacent_charclasses_differ[SP64-SP256]", + "eval.tests.test_charclass_goldens.test_adjacent_charclasses_differ[TAB8-SP16]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[BINMIX]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[CRLF8]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[CTRL]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[HEXLIKE]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[HIGHBIT]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[NULTERM]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[PRINTABLE]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[SP16]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[SP256]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[SP64]", + "eval.tests.test_charclass_goldens.test_charclass_payload_matches_golden[TAB8]", + "eval.tests.test_charclass_goldens.test_charclass_payloads_are_pairwise_distinct", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[10]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[11]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[12]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[13]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[14]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[15]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[16]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[17]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[1]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[2]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[3]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[4]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[5]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[6]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[7]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[8]", + "eval.tests.test_charclass_goldens.test_space_run_length_matches_golden[9]", + "eval.tests.test_charclass_goldens.test_space_run_lengths_are_pairwise_distinct", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[--]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[-]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[[filename]]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[a?b]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[nam*]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[semi;colon.bin]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[uni\\xc3\\xa9.txt]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[with space.bin]", + "eval.tests.test_cli_names.test_flag_like_real_file_is_digested[~]", + "eval.tests.test_cli_names.test_long_flag_like_name_readable", + "eval.tests.test_cli_names.test_placeholder_named_file_not_usage", + "eval.tests.test_cli_names.test_stdin_dash_when_file_exists_is_read", + "eval.tests.test_cli_names.test_whitespace_in_filename_is_path_character[embedded_tab]", + "eval.tests.test_cli_names.test_whitespace_in_filename_is_path_character[single_newline]", + "eval.tests.test_cli_names.test_whitespace_in_filename_is_path_character[single_tab]", + "eval.tests.test_content.test_appending_byte_changes_digest", + "eval.tests.test_content.test_binary_payloads_valid[.\\x00.\\x00]", + "eval.tests.test_content.test_binary_payloads_valid[\\x00\\x00\\x00\\x00]", + "eval.tests.test_content.test_binary_payloads_valid[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f]", + "eval.tests.test_content.test_binary_payloads_valid[\\x00\\xff\\x00\\xff]", + "eval.tests.test_content.test_binary_payloads_valid[\\x00]", + "eval.tests.test_content.test_binary_payloads_valid[\\x10 0@P`p\\x80\\x90\\xa0\\xb0\\xc0\\xd0\\xe0\\xf0\\x00]", + "eval.tests.test_content.test_binary_payloads_valid[\\x7f\\x80\\x7f]", + "eval.tests.test_content.test_binary_payloads_valid[\\x80\\x81\\xfe\\xff]", + "eval.tests.test_content.test_binary_payloads_valid[\\xca\\xfe\\xba\\xbe]", + "eval.tests.test_content.test_binary_payloads_valid[\\xde\\xad\\xbe\\xef]", + "eval.tests.test_content.test_binary_payloads_valid[\\xef\\xbb\\xbf]", + "eval.tests.test_content.test_binary_payloads_valid[\\xf0\\x9f\\x98\\x80]", + "eval.tests.test_content.test_binary_payloads_valid[\\xfe\\xed\\xfa\\xce]", + "eval.tests.test_content.test_binary_payloads_valid[\\xff\\xff\\xff\\xff]", + "eval.tests.test_content.test_distinct_single_bytes_distinct_digests[0-1]", + "eval.tests.test_content.test_distinct_single_bytes_distinct_digests[0-255]", + "eval.tests.test_content.test_distinct_single_bytes_distinct_digests[127-128]", + "eval.tests.test_content.test_distinct_single_bytes_distinct_digests[65-66]", + "eval.tests.test_content.test_length_change_changes_digest[1-2]", + "eval.tests.test_content.test_length_change_changes_digest[1024-1025]", + "eval.tests.test_content.test_length_change_changes_digest[255-256]", + "eval.tests.test_content.test_length_change_changes_digest[63-64]", + "eval.tests.test_content.test_length_change_changes_digest[64-65]", + "eval.tests.test_content.test_length_variants_valid[1023]", + "eval.tests.test_content.test_length_variants_valid[1024]", + "eval.tests.test_content.test_length_variants_valid[127]", + "eval.tests.test_content.test_length_variants_valid[128]", + "eval.tests.test_content.test_length_variants_valid[1]", + "eval.tests.test_content.test_length_variants_valid[2048]", + "eval.tests.test_content.test_length_variants_valid[255]", + "eval.tests.test_content.test_length_variants_valid[256]", + "eval.tests.test_content.test_length_variants_valid[2]", + "eval.tests.test_content.test_length_variants_valid[3]", + "eval.tests.test_content.test_length_variants_valid[63]", + "eval.tests.test_content.test_length_variants_valid[64]", + "eval.tests.test_content.test_length_variants_valid[65]", + "eval.tests.test_content.test_order_matters", + "eval.tests.test_content.test_pairwise_distinct_small_set", + "eval.tests.test_content.test_prepending_byte_changes_digest", + "eval.tests.test_content.test_representative_byte_valid[0]", + "eval.tests.test_content.test_representative_byte_valid[10]", + "eval.tests.test_content.test_representative_byte_valid[122]", + "eval.tests.test_content.test_representative_byte_valid[127]", + "eval.tests.test_content.test_representative_byte_valid[128]", + "eval.tests.test_content.test_representative_byte_valid[129]", + "eval.tests.test_content.test_representative_byte_valid[13]", + "eval.tests.test_content.test_representative_byte_valid[1]", + "eval.tests.test_content.test_representative_byte_valid[254]", + "eval.tests.test_content.test_representative_byte_valid[255]", + "eval.tests.test_content.test_representative_byte_valid[2]", + "eval.tests.test_content.test_representative_byte_valid[31]", + "eval.tests.test_content.test_representative_byte_valid[32]", + "eval.tests.test_content.test_representative_byte_valid[65]", + "eval.tests.test_content.test_representative_byte_valid[90]", + "eval.tests.test_content.test_representative_byte_valid[97]", + "eval.tests.test_content.test_single_byte_value_pinned_to_golden[A-65]", + "eval.tests.test_content.test_single_byte_value_pinned_to_golden[NUL-0]", + "eval.tests.test_content.test_single_nonempty_byte_differs_from_empty_stream[0]", + "eval.tests.test_content.test_single_nonempty_byte_differs_from_empty_stream[128]", + "eval.tests.test_content.test_single_nonempty_byte_differs_from_empty_stream[255]", + "eval.tests.test_content.test_single_nonempty_byte_differs_from_empty_stream[65]", + "eval.tests.test_content.test_text_payloads_valid[ \\t\\r\\n]", + "eval.tests.test_content.test_text_payloads_valid[---]", + "eval.tests.test_content.test_text_payloads_valid[....]", + "eval.tests.test_content.test_text_payloads_valid[0123456789]", + "eval.tests.test_content.test_text_payloads_valid[0xDEADBEEF0123456789]", + "eval.tests.test_content.test_text_payloads_valid[ABCDEFGHIJKLMNOPQRSTUVWXYZ]", + "eval.tests.test_content.test_text_payloads_valid[\\n]", + "eval.tests.test_content.test_text_payloads_valid[\\r\\n]", + "eval.tests.test_content.test_text_payloads_valid[\\t]", + "eval.tests.test_content.test_text_payloads_valid[\\x1b[31mANSI\\x1b[0m]", + "eval.tests.test_content.test_text_payloads_valid[a]", + "eval.tests.test_content.test_text_payloads_valid[abc]", + "eval.tests.test_content.test_text_payloads_valid[abcdefghijklmnopqrstuvwxyz]", + "eval.tests.test_content.test_text_payloads_valid[all.delimiters-_.~]", + "eval.tests.test_content.test_text_payloads_valid[b]", + "eval.tests.test_content.test_text_payloads_valid[hello worl!]", + "eval.tests.test_content.test_text_payloads_valid[hello world]", + "eval.tests.test_content.test_text_payloads_valid[repeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-reprepeat-rep]", + "eval.tests.test_content.test_text_payloads_valid[spaces and tabs\\tcontent]", + "eval.tests.test_content.test_text_payloads_valid[the quick brown fox jumps over the lazy dog]", + "eval.tests.test_content.test_text_payloads_valid[unicode-\\xc3\\xa9t\\xc3\\xa9]", + "eval.tests.test_content.test_text_payloads_valid[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]", + "eval.tests.test_content.test_text_payloads_valid[yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy]", + "eval.tests.test_content.test_two_equal_files_same_digest", + "eval.tests.test_empty_baseline.test_created_empty_file_matches_empty_golden", + "eval.tests.test_empty_baseline.test_devnull_equals_empty_golden", + "eval.tests.test_empty_baseline.test_distinct_empty_entries_agree", + "eval.tests.test_empty_baseline.test_empty_deterministic_across_runs", + "eval.tests.test_empty_baseline.test_empty_files_equal_golden_parameterized[a]", + "eval.tests.test_empty_baseline.test_empty_files_equal_golden_parameterized[empty_used]", + "eval.tests.test_empty_baseline.test_empty_files_equal_golden_parameterized[nul.bin]", + "eval.tests.test_empty_baseline.test_empty_files_equal_golden_parameterized[zz.bin]", + "eval.tests.test_empty_baseline.test_empty_output_structure_five_lines_three_tokens", + "eval.tests.test_empty_baseline.test_empty_output_structure_hex_tokens", + "eval.tests.test_empty_baseline.test_missing_file_matches_empty_golden", + "eval.tests.test_empty_baseline.test_removed_before_open_matches_empty_golden", + "eval.tests.test_error_paths.test_deep_directory_chain_aborts", + "eval.tests.test_error_paths.test_directory_argument_aborts_sigabrt", + "eval.tests.test_error_paths.test_directory_argument_emits_no_checksum", + "eval.tests.test_error_paths.test_directory_argument_stderr_says_not_a_regular_file", + "eval.tests.test_error_paths.test_directory_nested_inside_aborts", + "eval.tests.test_error_paths.test_directory_with_trailing_slash_aborts", + "eval.tests.test_error_paths.test_missing_file_yields_empty_baseline", + "eval.tests.test_error_paths.test_removal_before_open_yields_empty_baseline", + "eval.tests.test_format_determinism.test_all_fifteen_tokens_present", + "eval.tests.test_format_determinism.test_five_lines_exactly[!\"#]", + "eval.tests.test_format_determinism.test_five_lines_exactly[00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000]", + "eval.tests.test_format_determinism.test_five_lines_exactly[\\x01\\x02]", + "eval.tests.test_format_determinism.test_five_lines_exactly[\\xff]", + "eval.tests.test_format_determinism.test_five_lines_exactly[]", + "eval.tests.test_format_determinism.test_five_lines_exactly[abc]", + "eval.tests.test_format_determinism.test_golden_abc_matches", + "eval.tests.test_format_determinism.test_golden_abc_no_extra_output", + "eval.tests.test_format_determinism.test_output_is_whitespace_tab_separated", + "eval.tests.test_format_determinism.test_repeated_runs_identical[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]", + "eval.tests.test_format_determinism.test_repeated_runs_identical[\\x00\\xff]", + "eval.tests.test_format_determinism.test_repeated_runs_identical[]", + "eval.tests.test_format_determinism.test_repeated_runs_identical[abc]", + "eval.tests.test_format_determinism.test_repeated_runs_identical[hello world]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[\\n\\n]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[\\t\\t]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[\\x00]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[abc]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[qqqqqqqqqq]", + "eval.tests.test_format_determinism.test_three_tokens_per_row[xyz]", + "eval.tests.test_format_determinism.test_tokens_lowercase_hex[---]", + "eval.tests.test_format_determinism.test_tokens_lowercase_hex[\\x99\\x88]", + "eval.tests.test_format_determinism.test_tokens_lowercase_hex[]", + "eval.tests.test_format_determinism.test_tokens_lowercase_hex[abc]", + "eval.tests.test_format_determinism.test_tokens_lowercase_hex[zzzzzzz]", + "eval.tests.test_golden_payloads.test_4096_byte_payload_matches_golden[A4096-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]", + "eval.tests.test_golden_payloads.test_all_goldens_are_distinct", + "eval.tests.test_golden_payloads.test_fixed_payload_matches_golden[fox-The quick brown fox jumps over the lazy dog]", + "eval.tests.test_golden_payloads.test_fixed_payload_matches_golden[hello-hello world]", + "eval.tests.test_golden_payloads.test_fixed_payload_matches_golden[kv-key=value\\n]", + "eval.tests.test_golden_payloads.test_fixed_payload_matches_golden[libchaos-libchaos]", + "eval.tests.test_golden_payloads.test_fixed_payload_matches_golden[lines-line1\\nline2\\nline3\\n]", + "eval.tests.test_large_inputs.test_large_order_sensitivity", + "eval.tests.test_large_inputs.test_large_payload_content_sensitive[1048576]", + "eval.tests.test_large_inputs.test_large_payload_content_sensitive[4096]", + "eval.tests.test_large_inputs.test_large_payload_content_sensitive[512]", + "eval.tests.test_large_inputs.test_large_payload_content_sensitive[65536]", + "eval.tests.test_large_inputs.test_large_payload_deterministic[1048576]", + "eval.tests.test_large_inputs.test_large_payload_deterministic[4096]", + "eval.tests.test_large_inputs.test_large_payload_deterministic[512]", + "eval.tests.test_large_inputs.test_large_payload_deterministic[65536]", + "eval.tests.test_large_inputs.test_large_payloads_matches_golden[1048576]", + "eval.tests.test_large_inputs.test_large_payloads_matches_golden[4096]", + "eval.tests.test_large_inputs.test_large_payloads_matches_golden[512]", + "eval.tests.test_large_inputs.test_large_payloads_matches_golden[65536]", + "eval.tests.test_large_inputs.test_megabyte_golden_matches", + "eval.tests.test_large_inputs.test_two_patterns_same_length_distinct", + "eval.tests.test_link_stateful_chains.test_hardlink_tracks_target_mutation", + "eval.tests.test_link_stateful_chains.test_relative_symlink_resolves_digest", + "eval.tests.test_link_stateful_chains.test_relink_to_new_target_changes_digest", + "eval.tests.test_link_stateful_chains.test_symlink_loop_yields_empty_golden[cycle]", + "eval.tests.test_link_stateful_chains.test_symlink_loop_yields_empty_golden[self]", + "eval.tests.test_link_stateful_chains.test_symlink_target_removal_yields_empty_golden", + "eval.tests.test_link_stateful_chains.test_symlink_tracks_target_mutation_and_revert", + "eval.tests.test_position_length_sensitivity.test_all_position_flips_mutually_distinct", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[0]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[10]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[11]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[12]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[13]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[14]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[15]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[1]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[2]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[3]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[4]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[5]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[6]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[7]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[8]", + "eval.tests.test_position_length_sensitivity.test_flip_at_position_changes_digest[9]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[1023]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[1024]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[1048576]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[127]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[128]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[16]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[1]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[255]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[256]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[262144]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[2]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[31]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[32]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[33]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[4096]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[4]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[511]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[512]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[63]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[64]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[65536]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[65]", + "eval.tests.test_position_length_sensitivity.test_length_produces_valid_block[8]", + "eval.tests.test_position_length_sensitivity.test_length_sweep_pairwise_distinct", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[1023]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[1024]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[127]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[128]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[1]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[255]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[256]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[511]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[512]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[63]", + "eval.tests.test_position_length_sensitivity.test_size_differ_by_one_changes_digest[64]", + "eval.tests.test_process_isolation.test_different_files_yield_distinct_isolated_digests", + "eval.tests.test_process_isolation.test_digest_independent_of_prior_runs", + "eval.tests.test_process_isolation.test_five_token_block_invariants_per_process", + "eval.tests.test_process_isolation.test_same_file_identical_across_many_runs", + "eval.tests.test_process_isolation.test_two_copies_same_content_same_digest_across_processes", + "eval.tests.test_public_surface.test_64k_all_a_matches_golden", + "eval.tests.test_public_surface.test_all_fifteen_tokens_unique_in_block[AAAAAAAAAAAAAAAA-A16]", + "eval.tests.test_public_surface.test_all_fifteen_tokens_unique_in_block[\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00-N16]", + "eval.tests.test_public_surface.test_all_fifteen_tokens_unique_in_block[abc-abc]", + "eval.tests.test_public_surface.test_all_fifteen_tokens_unique_in_block[hello world-hello]", + "eval.tests.test_public_surface.test_argv0_with_spaces_printed_literally", + "eval.tests.test_public_surface.test_boundary_payload_matches_golden[A16-AAAAAAAAAAAAAAAA]", + "eval.tests.test_public_surface.test_boundary_payload_matches_golden[N16-\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00]", + "eval.tests.test_public_surface.test_boundary_payload_matches_golden[NL3-\\n\\n\\n]", + "eval.tests.test_public_surface.test_boundary_payload_matches_golden[SP5- ]", + "eval.tests.test_public_surface.test_boundary_payloads_are_pairwise_distinct", + "eval.tests.test_public_surface.test_custom_argv0_still_reads_filename", + "eval.tests.test_public_surface.test_embedded_binary_matches_golden[MIX32-\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f]", + "eval.tests.test_public_surface.test_embedded_binary_matches_golden[NULTXT-ab\\x00cd\\x00ef]", + "eval.tests.test_public_surface.test_nonempty_input_yields_nonzero_words", + "eval.tests.test_public_surface.test_proc_binary_text_files_readable[/proc/self/cmdline]", + "eval.tests.test_public_surface.test_proc_binary_text_files_readable[/proc/self/status]", + "eval.tests.test_public_surface.test_proc_file_differs_from_empty_stream[/proc/meminfo]", + "eval.tests.test_public_surface.test_proc_file_differs_from_empty_stream[/proc/uptime]", + "eval.tests.test_public_surface.test_proc_file_differs_from_empty_stream[/proc/version]", + "eval.tests.test_public_surface.test_proc_file_readable_valid_block[/proc/loadavg]", + "eval.tests.test_public_surface.test_proc_file_readable_valid_block[/proc/meminfo]", + "eval.tests.test_public_surface.test_proc_file_readable_valid_block[/proc/self/mountinfo]", + "eval.tests.test_public_surface.test_proc_file_readable_valid_block[/proc/uptime]", + "eval.tests.test_public_surface.test_proc_file_readable_valid_block[/proc/version]", + "eval.tests.test_public_surface.test_proc_reads_deterministic_and_path_distinct", + "eval.tests.test_public_surface.test_proc_version_deterministic_across_runs", + "eval.tests.test_public_surface.test_tokens_bounded_to_64bit", + "eval.tests.test_public_surface.test_usage_line_reflects_caller_argv0", + "eval.tests.test_scale_multi_block.test_scale_content_sensitive[16]", + "eval.tests.test_scale_multi_block.test_scale_content_sensitive[2]", + "eval.tests.test_scale_multi_block.test_scale_content_sensitive[4]", + "eval.tests.test_scale_multi_block.test_scale_content_sensitive[8]", + "eval.tests.test_scale_multi_block.test_scale_deterministic_across_runs[16]", + "eval.tests.test_scale_multi_block.test_scale_deterministic_across_runs[2]", + "eval.tests.test_scale_multi_block.test_scale_deterministic_across_runs[4]", + "eval.tests.test_scale_multi_block.test_scale_deterministic_across_runs[8]", + "eval.tests.test_scale_multi_block.test_scale_pairwise_distinct_by_size", + "eval.tests.test_scale_multi_block.test_scale_payload_matches_golden[16]", + "eval.tests.test_scale_multi_block.test_scale_payload_matches_golden[2]", + "eval.tests.test_scale_multi_block.test_scale_payload_matches_golden[4]", + "eval.tests.test_scale_multi_block.test_scale_payload_matches_golden[8]", + "eval.tests.test_scale_multi_block.test_scale_valid_five_by_three[16]", + "eval.tests.test_scale_multi_block.test_scale_valid_five_by_three[2]", + "eval.tests.test_scale_multi_block.test_scale_valid_five_by_three[4]", + "eval.tests.test_scale_multi_block.test_scale_valid_five_by_three[8]", + "eval.tests.test_stateful_chains.test_append_changes_digest_then_revert_truncate", + "eval.tests.test_stateful_chains.test_empty_then_fill_then_empty_roundtrip", + "eval.tests.test_stateful_chains.test_modify_revert_restores_digest", + "eval.tests.test_stateful_chains.test_repeated_same_write_is_stable", + "eval.tests.test_stateful_chains.test_shrink_then_regrow_changes_and_restores", + "eval.tests.test_stateful_chains.test_single_byte_flip_changes_digest", + "eval.tests.test_stateful_chains.test_truncate_to_zero_returns_empty_baseline", + "eval.tests.test_symlink_links.test_dangling_symlink_equals_empty_baseline", + "eval.tests.test_symlink_links.test_hardlink_equals_target_digest", + "eval.tests.test_symlink_links.test_symlink_equals_target_digest", + "eval.tests.test_symlink_links.test_symlink_to_directory_aborts", + "eval.tests.test_usage.test_empty_string_filename_proceeds_to_checksum", + "eval.tests.test_usage.test_no_args_exit_exact_one_and_no_stdin_effect", + "eval.tests.test_usage.test_no_args_line_embeds_argv0", + "eval.tests.test_usage.test_no_args_no_checksum_rows", + "eval.tests.test_usage.test_no_args_single_line_usage", + "eval.tests.test_usage.test_no_args_usage_on_stdout_only", + "eval.tests.test_usage.test_one_flag_like_dash_arg_is_filename" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_changes_first_pull[The quick brown fox jumps over the lazy dog\\n-perturbs1]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_changes_first_pull[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff-perturbs3]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_changes_first_pull[a-perturbs4]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_changes_first_pull[abc-perturbs2]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_changes_first_pull[hello-perturbs0]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_yields_disjoint_pulls[The quick brown fox jumps over the lazy dog\\n-perturbs1]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_yields_disjoint_pulls[\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff-perturbs3]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_yields_disjoint_pulls[a-perturbs4]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_yields_disjoint_pulls[abc-perturbs2]", + "eval.tests.test_file_checksum_avalanche.test_single_byte_change_yields_disjoint_pulls[hello-perturbs0]", + "eval.tests.test_file_checksum_cli.test_empty_file_yields_empty_input_signature", + "eval.tests.test_file_checksum_cli.test_no_arguments_prints_usage_and_exits_nonzero", + "eval.tests.test_file_checksum_cli.test_unopenable_file_treated_as_empty_input", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[abc.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[binary_bytes.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[empty.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[hello.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[hello_world.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[longer_text.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[newline_only.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[repeated_aa.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_same_file_twice_is_identical[the_quick_brown_fox.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[abc.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[binary_bytes.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[empty.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[hello.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[hello_world.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[longer_text.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[newline_only.txt]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[repeated_aa.bin]", + "eval.tests.test_file_checksum_determinism.test_hashing_stable_across_three_identical_runs[the_quick_brown_fox.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[abc.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[binary_bytes.bin]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[empty.bin]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[hello.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[hello_world.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[longer_text.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[newline_only.txt]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[repeated_aa.bin]", + "eval.tests.test_file_checksum_determinism.test_output_has_five_rows_of_three_pulls[the_quick_brown_fox.txt]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[abc.txt-abc]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[binary_bytes.bin-binary_bytes]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[empty.bin-empty]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[hello.txt-hello]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[hello_world.txt-hello_world]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[longer_text.txt-longer_text]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[newline_only.txt-newline_only]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[repeated_aa.bin-repeated_aa]", + "eval.tests.test_file_checksum_goldens.test_exact_pull_sequence_matches_golden[the_quick_brown_fox.txt-the_quick_brown_fox]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[abc.txt-abc]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[binary_bytes.bin-binary_bytes]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[empty.bin-empty]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[hello.txt-hello]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[hello_world.txt-hello_world]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[longer_text.txt-longer_text]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[newline_only.txt-newline_only]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[repeated_aa.bin-repeated_aa]", + "eval.tests.test_file_checksum_goldens.test_golden_has_exactly_fifteen_pulls[the_quick_brown_fox.txt-the_quick_brown_fox]", + "eval.tests.test_file_checksum_stateful.test_byte_ordering_is_sensitive[The quick-quick The]", + "eval.tests.test_file_checksum_stateful.test_byte_ordering_is_sensitive[aabb-abab]", + "eval.tests.test_file_checksum_stateful.test_byte_ordering_is_sensitive[ab-ba]", + "eval.tests.test_file_checksum_stateful.test_byte_ordering_is_sensitive[hello-ehllo]", + "eval.tests.test_file_checksum_stateful.test_concatenation_differs_from_parts", + "eval.tests.test_file_checksum_stateful.test_output_values_are_unique_within_run", + "eval.tests.test_file_checksum_stateful.test_partial_input_differs_from_whole", + "eval.tests.test_file_checksum_stateful.test_two_character_inputs_differ_by_bag_and_position" + ] + } + }, + "commit": "4412a894f353c6364169697b52515078760395f3", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 2.1621759365301623, + "eval_clean_hashes": [ + "48b7019f53ff726b99f5dce376f0e1108e30e01bec59c34430278da28dc4504e" + ], + "input_record": { + "commit": "4412a894f353c6364169697b52515078760395f3", + "difficulty": "medium", + "difficulty_code_lines": 14527, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 14527, + "difficulty_runtime_deps": 0, + "difficulty_score": 2.1621759365301623, + "difficulty_test_code_lines": 1154, + "full_name": "maciejczyzewski/libchaos", + "input_joern_zip": "cpp_joern/maciejczyzewski__libchaos.zip", + "joern_status": true, + "joern_time": 17.522724891081452, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 610, + "similarity": 0.47424739599227905 + }, + { + "pb_fullname": "ip7z/7zip", + "rank": 645, + "similarity": 0.38829612731933594 + }, + { + "pb_fullname": "ninja-build/ninja", + "rank": 779, + "similarity": 0.43247199058532715 + }, + { + "pb_fullname": "NikolaDucak/caps-log", + "rank": 912, + "similarity": 0.3828986883163452 + } + ], + "repo_path": "cpp/maciejczyzewski__libchaos", + "source": "commit:4412a894f353c6364169697b52515078760395f3", + "status": "done", + "url": "https://github.com/maciejczyzewski/libchaos" + }, + "instance_id": "maciejczyzewski__libchaos.4412a89", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 6, + "branch_name": "generated_module_01", + "iteration_limit": 10, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_02", + "iteration_limit": 10, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 6, + "branch_name": "generated_module_03", + "iteration_limit": 10, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 10, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_05", + "iteration_limit": 10, + "module_index": 5, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_06", + "iteration_limit": 10, + "module_index": 6, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 2, + "branch_name": "generated_upstream", + "iteration_limit": 10, + "module_index": 7, + "module_kind": "tests", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "maciejczyzewski/libchaos" +} diff --git a/maciejczyzewski--libchaos.4412a8/tests/test.sh b/maciejczyzewski--libchaos.4412a8/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/maciejczyzewski--libchaos.4412a8/tests/workspace.tar.gz b/maciejczyzewski--libchaos.4412a8/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6689226c33a151f2146b182983fe704c7598fcf9 --- /dev/null +++ b/maciejczyzewski--libchaos.4412a8/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fae7cfa563f25e79cea0ba6aca691213e3469ee8b7ce70184d25da10d4fee42 +size 8793 diff --git a/mackerelio--go-osstat.ca86009/environment/Dockerfile b/mackerelio--go-osstat.ca86009/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/mackerelio--go-osstat.ca86009/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mackerelio--go-osstat.ca86009/environment/download.sh b/mackerelio--go-osstat.ca86009/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..da33c73fbfaa488224301f5376b83cb04b740773 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/environment/download.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mackerelio/go-osstat + +go 1.25.0 + +require golang.org/x/sys v0.46.0 +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/mackerelio--go-osstat.ca86009/environment/executable b/mackerelio--go-osstat.ca86009/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..73007ef2695e268233865e3333f415f2a493d578 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:575244d3349068214ca102c930d540a56194c1d51fda17826ddc2df0306b8646 +size 2502760 diff --git a/mackerelio--go-osstat.ca86009/environment/programgym-go.tar.gz b/mackerelio--go-osstat.ca86009/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mackerelio--go-osstat.ca86009/environment/workspace.tar.gz b/mackerelio--go-osstat.ca86009/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8608452c7888ea3738c2338c2880dbe1f0ef994e --- /dev/null +++ b/mackerelio--go-osstat.ca86009/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:850fd723193729c34f2d018df0cadae6a88feff319f77dbd70e49960bc292df8 +size 1436 diff --git a/mackerelio--go-osstat.ca86009/instruction.md b/mackerelio--go-osstat.ca86009/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mackerelio--go-osstat.ca86009/solution/solve.sh b/mackerelio--go-osstat.ca86009/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mackerelio--go-osstat.ca86009/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mackerelio--go-osstat.ca86009/task.toml b/mackerelio--go-osstat.ca86009/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a96a51529d3de6c6e0838d17a2a01a037dbbcac1 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mackerelio--go-osstat.ca86009" +description = "Synthetic ProgramGym cleanroom reconstruction task for mackerelio/go-osstat" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "mackerelio__go-osstat.ca86009" +repository = "mackerelio/go-osstat" +commit = "ca8600925c157a175a3d7b59edd93ad63a5b78f6" +language = "go" +difficulty = "easy" +difficulty_score = 1.4149733479708182 +test_branches = 4 +test_count = 191 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mackerelio--go-osstat.ca86009/tests/Dockerfile b/mackerelio--go-osstat.ca86009/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_01.tar.gz b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8f4f647e723096861be1c70ca8f27a6f242b30bf --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d04d2fce499159367cfb7687d38d1a8f38c135f825ffb5f5626885296e5c687 +size 5569 diff --git a/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_02.tar.gz b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6e03d44fad1f9a00881e1763e314ea64209dc11f --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b772b5aaf5c6c0352ac3bd1629e652cc2919f30cf85ebd87392263334c577ab +size 3499 diff --git a/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_03.tar.gz b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c351077b6009112f93fc5c9f5d3b44ea5f98c80a --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc0e5968d3bb8d9f709b9c14c70073310458da21064aed79be8d1ae2b783be95 +size 5007 diff --git a/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_04.tar.gz b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c0a2afbc9b8de633ba7155eb4fe585eb368d970b --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef351b725581ee594fc258125ef3e26e71ae582f26e6af1c9564b77e5da1ea93 +size 5959 diff --git a/mackerelio--go-osstat.ca86009/tests/download.sh b/mackerelio--go-osstat.ca86009/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..da33c73fbfaa488224301f5376b83cb04b740773 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/download.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mackerelio/go-osstat + +go 1.25.0 + +require golang.org/x/sys v0.46.0 +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/mackerelio--go-osstat.ca86009/tests/executable b/mackerelio--go-osstat.ca86009/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..73007ef2695e268233865e3333f415f2a493d578 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:575244d3349068214ca102c930d540a56194c1d51fda17826ddc2df0306b8646 +size 2502760 diff --git a/mackerelio--go-osstat.ca86009/tests/programgym-go.tar.gz b/mackerelio--go-osstat.ca86009/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mackerelio--go-osstat.ca86009/tests/programgym_evaluator.py b/mackerelio--go-osstat.ca86009/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mackerelio--go-osstat.ca86009/tests/programgym_task.json b/mackerelio--go-osstat.ca86009/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..7f6e70e2e392125cbe7cad8ee3460ef9410b70f4 --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/programgym_task.json @@ -0,0 +1,322 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_osstat.test_consecutive_runs_expose_stable_core_metric_set", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[cpu.idle]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[cpu.system]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[cpu.total]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[cpu.user]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[loadavg.15m]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[loadavg.1m]", + "eval.tests.test_osstat.test_counter_metrics_report_dash_unit[loadavg.5m]", + "eval.tests.test_osstat.test_cpu_total_at_least_each_component", + "eval.tests.test_osstat.test_cpu_values_are_unsigned_integer[cpu.idle]", + "eval.tests.test_osstat.test_cpu_values_are_unsigned_integer[cpu.system]", + "eval.tests.test_osstat.test_cpu_values_are_unsigned_integer[cpu.total]", + "eval.tests.test_osstat.test_cpu_values_are_unsigned_integer[cpu.user]", + "eval.tests.test_osstat.test_default_invocation_prints_every_required_metric", + "eval.tests.test_osstat.test_default_invocation_succeeds_cleanly", + "eval.tests.test_osstat.test_disk_rows_are_dash_unit_and_unsigned", + "eval.tests.test_osstat.test_disk_rows_come_in_read_writes_pairs", + "eval.tests.test_osstat.test_extra_arguments_are_ignored", + "eval.tests.test_osstat.test_loadavg_values_are_nonnegative_float[loadavg.15m]", + "eval.tests.test_osstat.test_loadavg_values_are_nonnegative_float[loadavg.1m]", + "eval.tests.test_osstat.test_loadavg_values_are_nonnegative_float[loadavg.5m]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.active]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.cached]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.free]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.inactive]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.swap_free]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.swap_total]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.swap_used]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.total]", + "eval.tests.test_osstat.test_memory_metrics_report_byte_unit[memory.used]", + "eval.tests.test_osstat.test_memory_total_greater_or_equal_free", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.active]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.cached]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.free]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.inactive]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.swap_free]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.swap_total]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.swap_used]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.total]", + "eval.tests.test_osstat.test_memory_values_are_unsigned_integer[memory.used]", + "eval.tests.test_osstat.test_network_rows_are_byte_unit_and_unsigned", + "eval.tests.test_osstat.test_network_rows_come_in_rx_tx_pairs", + "eval.tests.test_osstat.test_output_line_format_three_tokens", + "eval.tests.test_osstat.test_required_metrics_each_present[cpu.idle]", + "eval.tests.test_osstat.test_required_metrics_each_present[cpu.system]", + "eval.tests.test_osstat.test_required_metrics_each_present[cpu.total]", + "eval.tests.test_osstat.test_required_metrics_each_present[cpu.user]", + "eval.tests.test_osstat.test_required_metrics_each_present[loadavg.15m]", + "eval.tests.test_osstat.test_required_metrics_each_present[loadavg.1m]", + "eval.tests.test_osstat.test_required_metrics_each_present[loadavg.5m]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.active]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.cached]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.free]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.inactive]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.swap_free]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.swap_total]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.swap_used]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.total]", + "eval.tests.test_osstat.test_required_metrics_each_present[memory.used]", + "eval.tests.test_osstat.test_required_metrics_each_present[uptime]", + "eval.tests.test_osstat.test_uptime_unit_seconds_and_six_decimals" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_osstat_cpu_memory.test_all_cpu_keys_present", + "eval.tests.test_osstat_cpu_memory.test_all_memory_keys_present", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args0]", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args1]", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args2]", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args3]", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args4]", + "eval.tests.test_osstat_cpu_memory.test_args_do_not_break_metric_output[args5]", + "eval.tests.test_osstat_cpu_memory.test_cpu_counters_non_decreasing[cpu.idle]", + "eval.tests.test_osstat_cpu_memory.test_cpu_counters_non_decreasing[cpu.system]", + "eval.tests.test_osstat_cpu_memory.test_cpu_counters_non_decreasing[cpu.total]", + "eval.tests.test_osstat_cpu_memory.test_cpu_counters_non_decreasing[cpu.user]", + "eval.tests.test_osstat_cpu_memory.test_cpu_emitted_before_memory", + "eval.tests.test_osstat_cpu_memory.test_cpu_metric_present_nonnegative_integer[cpu.idle]", + "eval.tests.test_osstat_cpu_memory.test_cpu_metric_present_nonnegative_integer[cpu.system]", + "eval.tests.test_osstat_cpu_memory.test_cpu_metric_present_nonnegative_integer[cpu.total]", + "eval.tests.test_osstat_cpu_memory.test_cpu_metric_present_nonnegative_integer[cpu.user]", + "eval.tests.test_osstat_cpu_memory.test_cpu_total_ge_component[cpu.idle]", + "eval.tests.test_osstat_cpu_memory.test_cpu_total_ge_component[cpu.system]", + "eval.tests.test_osstat_cpu_memory.test_cpu_total_ge_component[cpu.user]", + "eval.tests.test_osstat_cpu_memory.test_cpu_user_system_idle_lt_total", + "eval.tests.test_osstat_cpu_memory.test_cpu_user_system_lt_total", + "eval.tests.test_osstat_cpu_memory.test_memory_active_inactive_le_total[active]", + "eval.tests.test_osstat_cpu_memory.test_memory_active_inactive_le_total[inactive]", + "eval.tests.test_osstat_cpu_memory.test_memory_free_le_total", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.active]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.cached]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.free]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.inactive]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.swap_free]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.swap_total]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.swap_used]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.total]", + "eval.tests.test_osstat_cpu_memory.test_memory_metric_present_nonnegative_bytes[memory.used]", + "eval.tests.test_osstat_cpu_memory.test_memory_total_nonzero", + "eval.tests.test_osstat_cpu_memory.test_memory_used_lt_total", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.active]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.cached]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.free]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.inactive]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.swap_free]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.swap_total]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.swap_used]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.total]", + "eval.tests.test_osstat_cpu_memory.test_memory_values_multiple_of_1024[memory.used]", + "eval.tests.test_osstat_cpu_memory.test_swap_bounds[swap_free]", + "eval.tests.test_osstat_cpu_memory.test_swap_bounds[swap_used]", + "eval.tests.test_osstat_cpu_memory.test_swap_used_is_total_minus_free" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_disk_io.test_all_disk_output_has_dash_unit", + "eval.tests.test_disk_io.test_disk_lines_follow_exact_format", + "eval.tests.test_disk_io.test_disk_reads_reported[loop0]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop1]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop2]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop3]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop4]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop5]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop6]", + "eval.tests.test_disk_io.test_disk_reads_reported[loop7]", + "eval.tests.test_disk_io.test_disk_reads_reported[nvme0n1]", + "eval.tests.test_disk_io.test_disk_reads_reported[nvme0n1p1]", + "eval.tests.test_disk_io.test_disk_reads_reported[nvme0n1p2]", + "eval.tests.test_disk_io.test_disk_reads_reported[nvme1n1]", + "eval.tests.test_disk_io.test_disk_reads_reported[nvme2n1]", + "eval.tests.test_disk_io.test_disk_report_has_at_least_one_device", + "eval.tests.test_disk_io.test_disk_writes_reported[loop0]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop1]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop2]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop3]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop4]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop5]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop6]", + "eval.tests.test_disk_io.test_disk_writes_reported[loop7]", + "eval.tests.test_disk_io.test_disk_writes_reported[nvme0n1]", + "eval.tests.test_disk_io.test_disk_writes_reported[nvme0n1p1]", + "eval.tests.test_disk_io.test_disk_writes_reported[nvme0n1p2]", + "eval.tests.test_disk_io.test_disk_writes_reported[nvme1n1]", + "eval.tests.test_disk_io.test_disk_writes_reported[nvme2n1]", + "eval.tests.test_disk_io.test_each_device_emits_both_reads_and_writes", + "eval.tests.test_disk_io.test_every_emitted_device_is_in_proc", + "eval.tests.test_network_io.test_all_network_output_has_bytes_unit", + "eval.tests.test_network_io.test_each_interface_emits_both_rx_and_tx", + "eval.tests.test_network_io.test_every_emitted_interface_is_in_proc", + "eval.tests.test_network_io.test_network_lines_follow_exact_format", + "eval.tests.test_network_io.test_network_loopback_interface_is_excluded", + "eval.tests.test_network_io.test_network_report_has_at_least_one_interface", + "eval.tests.test_network_io.test_network_rx_bytes_reported[eth0]", + "eval.tests.test_network_io.test_network_rx_bytes_reported[tunl0]", + "eval.tests.test_network_io.test_network_tx_bytes_reported[eth0]", + "eval.tests.test_network_io.test_network_tx_bytes_reported[tunl0]", + "eval.tests.test_process_contract.test_clean_run_emits_network_and_disk_families", + "eval.tests.test_process_contract.test_clean_run_has_no_error_prefix_lines", + "eval.tests.test_process_contract.test_stray_arguments_do_not_break_report" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args0]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args10]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args11]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args12]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args13]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args14]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args15]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args16]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args17]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args1]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args2]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args3]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args4]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args5]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args6]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args7]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args8]", + "eval.tests.test_cli.test_arguments_ignored_still_emit_owned_metrics[args9]", + "eval.tests.test_cli.test_empty_stdin_is_ignored", + "eval.tests.test_cli.test_exit_zero_on_success", + "eval.tests.test_cli.test_loadavg_present_with_stdin_piped", + "eval.tests.test_cli.test_module_keys_units", + "eval.tests.test_cli.test_stderr_is_empty_on_success", + "eval.tests.test_cli.test_stdin_is_ignored", + "eval.tests.test_cli.test_uptime_present_with_stdin_piped", + "eval.tests.test_loadavg.test_all_three_loadavg_keys_present", + "eval.tests.test_loadavg.test_loadavg_five_and_fifteen_minute_scale", + "eval.tests.test_loadavg.test_loadavg_keys_appear_exactly_once", + "eval.tests.test_loadavg.test_loadavg_line_has_name_value_unit[loadavg.15m]", + "eval.tests.test_loadavg.test_loadavg_line_has_name_value_unit[loadavg.1m]", + "eval.tests.test_loadavg.test_loadavg_line_has_name_value_unit[loadavg.5m]", + "eval.tests.test_loadavg.test_loadavg_matches_proc_source[loadavg.15m-2]", + "eval.tests.test_loadavg.test_loadavg_matches_proc_source[loadavg.1m-0]", + "eval.tests.test_loadavg.test_loadavg_matches_proc_source[loadavg.5m-1]", + "eval.tests.test_uptime.test_uptime_is_positive", + "eval.tests.test_uptime.test_uptime_key_present_with_seconds_unit", + "eval.tests.test_uptime.test_uptime_matches_proc_uptime", + "eval.tests.test_uptime.test_uptime_rendered_in_integer_seconds" + ] + } + }, + "commit": "ca8600925c157a175a3d7b59edd93ad63a5b78f6", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.4149733479708182, + "eval_clean_hashes": [ + "575244d3349068214ca102c930d540a56194c1d51fda17826ddc2df0306b8646" + ], + "input_record": { + "commit": "ca8600925c157a175a3d7b59edd93ad63a5b78f6", + "commits": 311, + "contributors": 16, + "difficulty": "easy", + "difficulty_code_lines": 1300, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1300, + "difficulty_runtime_deps": 1, + "difficulty_score": 1.4149733479708182, + "difficulty_test_code_lines": 649, + "full_name": "mackerelio/go-osstat", + "github_stars": 423, + "input_joern_zip": "go_joern/mackerelio__go-osstat.zip", + "joern_status": true, + "joern_time": 8.841897740960121, + "language": "go", + "pb_match": [ + { + "pb_fullname": "go-critic/go-critic", + "rank": 621, + "similarity": 0.5234241485595703 + }, + { + "pb_fullname": "mfridman/tparse", + "rank": 394, + "similarity": 0.5367469787597656 + }, + { + "pb_fullname": "incu6us/goimports-reviser", + "rank": 728, + "similarity": 0.49129587411880493 + }, + { + "pb_fullname": "psampaz/go-mod-outdated", + "rank": 411, + "similarity": 0.49039217829704285 + }, + { + "pb_fullname": "kisielk/errcheck", + "rank": 923, + "similarity": 0.5268566608428955 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 863, + "similarity": 0.4789908528327942 + } + ], + "repo_age": 8.8, + "repo_path": "go/mackerelio__go-osstat", + "source": "commit:ca8600925c157a175a3d7b59edd93ad63a5b78f6", + "status": "done", + "url": "https://github.com/mackerelio/go-osstat" + }, + "instance_id": "mackerelio__go-osstat.ca86009", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "mackerelio/go-osstat" +} diff --git a/mackerelio--go-osstat.ca86009/tests/test.sh b/mackerelio--go-osstat.ca86009/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mackerelio--go-osstat.ca86009/tests/workspace.tar.gz b/mackerelio--go-osstat.ca86009/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8608452c7888ea3738c2338c2880dbe1f0ef994e --- /dev/null +++ b/mackerelio--go-osstat.ca86009/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:850fd723193729c34f2d018df0cadae6a88feff319f77dbd70e49960bc292df8 +size 1436 diff --git a/madskjeldgaard--portedplugins.c6/environment/Dockerfile b/madskjeldgaard--portedplugins.c6/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bcfa04437d24f8eb8652a133e82f9c25c0c57a0 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/madskjeldgaard--portedplugins.c6/environment/docker-compose.yaml b/madskjeldgaard--portedplugins.c6/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/madskjeldgaard--portedplugins.c6/environment/download.sh b/madskjeldgaard--portedplugins.c6/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a6dda4c13fde472a844b72be5ad1bf2fdf35b1eb --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/download.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# ProgramGym dependency prefetch for PortedPlugins (SuperCollider UGen plugin +# collection). This file is SOURCED (`source /source_ro/download.sh`), so it must +# keep exported environment variables in the current shell and must not call +# `exit` in normal control flow. +# +# It prepares a single dependency that build.sh relies on: +# - SC_PATH : a writable SuperCollider plugin-header tree (include/plugin_interface, +# include/common, common, SCVersion.txt) populated via a git sparse +# checkout of the supercollider "develop" branch. +# +# It does NOT compile, link, test, or install anything, and it performs no build +# step. build_target_manifest.json records that no third-party dependency archive +# is needed: the configure guard is satisfied offline by a stub generated inside +# build.sh (USE_DAISYSP_LIB=OFF means no daisysp package is fetched). + +# --------------------------------------------------------------------------- +# Resolve a writable deps root where the SuperCollider headers can live. +# Prefer a location that persists into the offline build stage. +# --------------------------------------------------------------------------- +if [ -n "${PORTEDPLUGINS_DEPS_HOME:-}" ]; then + DEPS_HOME="$PORTEDPLUGINS_DEPS_HOME" +else + DEPS_HOME="" + for cand in "/workspace/portedplugins_deps" "$HOME/portedplugins_deps" "/tmp/portedplugins_deps"; do + if [ -d "$cand" ]; then + DEPS_HOME="$cand" + break + elif [ ! -e "$cand" ] && mkdir -p "$cand"; then + DEPS_HOME="$cand" + break + fi + done + if [ -z "$DEPS_HOME" ]; then + echo "download.sh: could not choose a writable dependencies directory" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi +fi +export PORTEDPLUGINS_DEPS_HOME="$DEPS_HOME" + +# --------------------------------------------------------------------------- +# SuperCollider plugin headers (SC_PATH) +# --------------------------------------------------------------------------- +SC_PATH="$DEPS_HOME/supercollider-src" +export SC_PATH + +if [ -f "$SC_PATH/include/plugin_interface/SC_PlugIn.h" ]; then + echo "download.sh: SuperCollider plugin headers already present at $SC_PATH" +else + echo "download.sh: fetching SuperCollider plugin headers (sparse checkout of develop)..." + rm -rf "$SC_PATH" + if ! git clone -q --depth 1 --branch develop --single-branch --filter=blob:none --sparse \ + https://github.com/supercollider/supercollider.git "$SC_PATH"; then + echo "download.sh: git clone of SuperCollider failed" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi + if ! git -C "$SC_PATH" sparse-checkout set \ + include/plugin_interface include/common common SCVersion.txt; then + echo "download.sh: sparse checkout of SuperCollider headers failed" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi +fi + +if [ ! -f "$SC_PATH/include/plugin_interface/SC_PlugIn.h" ]; then + echo "download.sh: SuperCollider plugin headers missing at $SC_PATH" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi +fi +if [ ! -f "$SC_PATH/SCVersion.txt" ]; then + echo "download.sh: SCVersion.txt missing at $SC_PATH" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi +fi + +echo "download.sh: dependency prefetch complete." +echo " SC_PATH=$SC_PATH" diff --git a/madskjeldgaard--portedplugins.c6/environment/executable b/madskjeldgaard--portedplugins.c6/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..cc457c8dce215feac8be36441abda16f14921d2b Binary files /dev/null and b/madskjeldgaard--portedplugins.c6/environment/executable differ diff --git a/madskjeldgaard--portedplugins.c6/environment/harbor_configure_apt_mirror.sh b/madskjeldgaard--portedplugins.c6/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/madskjeldgaard--portedplugins.c6/environment/harbor_prepare_download_env.sh b/madskjeldgaard--portedplugins.c6/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/madskjeldgaard--portedplugins.c6/environment/workspace.tar.gz b/madskjeldgaard--portedplugins.c6/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5a2790cdf5d8d08e89e608e84c4d80535448c1ec --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:beb2b01037473c250a2eac0ad00bb3dd3c0383388f830af74ceb48fdc4d71cd9 +size 9476 diff --git a/madskjeldgaard--portedplugins.c6/instruction.md b/madskjeldgaard--portedplugins.c6/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/madskjeldgaard--portedplugins.c6/solution/solve.sh b/madskjeldgaard--portedplugins.c6/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/madskjeldgaard--portedplugins.c6/task.toml b/madskjeldgaard--portedplugins.c6/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1668d39bbcb1857e14388e16530f801a2644f133 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/madskjeldgaard--portedplugins.c6" +description = "Synthetic ProgramGym cleanroom reconstruction task for madskjeldgaard/portedplugins" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "madskjeldgaard__portedplugins.c6c0d74" +repository = "madskjeldgaard/portedplugins" +commit = "c6c0d7430e9bc8e8aaeae3db8263e1dbb8f398eb" +language = "cpp" +difficulty = "medium" +difficulty_score = 2.0943662983361344 +test_branches = 4 +test_count = 163 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/madskjeldgaard--portedplugins.c6/tests/Dockerfile b/madskjeldgaard--portedplugins.c6/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef45becedb352d71e0d28eefebe80e3c73de2bd3 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/Dockerfile @@ -0,0 +1,72 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_01.tar.gz b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1dd9e59f369d8ac4d572f944ba0ed69b59092648 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f802e691c15969a2894ce6ad7400e5339242c580061ce04332b3c8314e392558 +size 21931 diff --git a/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_02.tar.gz b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..88d90b6fccf05d5c02ec1322ee295f6624018a6f --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f6b1cea21b5f32495d4d1a6a62cf1dfd81b50033d53407573e9ed492fd4190b +size 30315 diff --git a/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_04.tar.gz b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..61f300f54668738885ddb90b224c251e48311673 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0105285b645b9e9f32ed4844599351a1c4376c723e187701c6a4b602fab2a79f +size 29968 diff --git a/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_05.tar.gz b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_05.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b0993553a51f25b0d98aada41e38f14185f11586 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/blobs/tests/generated_module_05.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9a35700bff1ddb2a2b5ebccdf22f96694020b6f094a7a21d39d8b2eb6977ee9 +size 22503 diff --git a/madskjeldgaard--portedplugins.c6/tests/docker-compose.yaml b/madskjeldgaard--portedplugins.c6/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/madskjeldgaard--portedplugins.c6/tests/download.sh b/madskjeldgaard--portedplugins.c6/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a6dda4c13fde472a844b72be5ad1bf2fdf35b1eb --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/download.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# ProgramGym dependency prefetch for PortedPlugins (SuperCollider UGen plugin +# collection). This file is SOURCED (`source /source_ro/download.sh`), so it must +# keep exported environment variables in the current shell and must not call +# `exit` in normal control flow. +# +# It prepares a single dependency that build.sh relies on: +# - SC_PATH : a writable SuperCollider plugin-header tree (include/plugin_interface, +# include/common, common, SCVersion.txt) populated via a git sparse +# checkout of the supercollider "develop" branch. +# +# It does NOT compile, link, test, or install anything, and it performs no build +# step. build_target_manifest.json records that no third-party dependency archive +# is needed: the configure guard is satisfied offline by a stub generated inside +# build.sh (USE_DAISYSP_LIB=OFF means no daisysp package is fetched). + +# --------------------------------------------------------------------------- +# Resolve a writable deps root where the SuperCollider headers can live. +# Prefer a location that persists into the offline build stage. +# --------------------------------------------------------------------------- +if [ -n "${PORTEDPLUGINS_DEPS_HOME:-}" ]; then + DEPS_HOME="$PORTEDPLUGINS_DEPS_HOME" +else + DEPS_HOME="" + for cand in "/workspace/portedplugins_deps" "$HOME/portedplugins_deps" "/tmp/portedplugins_deps"; do + if [ -d "$cand" ]; then + DEPS_HOME="$cand" + break + elif [ ! -e "$cand" ] && mkdir -p "$cand"; then + DEPS_HOME="$cand" + break + fi + done + if [ -z "$DEPS_HOME" ]; then + echo "download.sh: could not choose a writable dependencies directory" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi +fi +export PORTEDPLUGINS_DEPS_HOME="$DEPS_HOME" + +# --------------------------------------------------------------------------- +# SuperCollider plugin headers (SC_PATH) +# --------------------------------------------------------------------------- +SC_PATH="$DEPS_HOME/supercollider-src" +export SC_PATH + +if [ -f "$SC_PATH/include/plugin_interface/SC_PlugIn.h" ]; then + echo "download.sh: SuperCollider plugin headers already present at $SC_PATH" +else + echo "download.sh: fetching SuperCollider plugin headers (sparse checkout of develop)..." + rm -rf "$SC_PATH" + if ! git clone -q --depth 1 --branch develop --single-branch --filter=blob:none --sparse \ + https://github.com/supercollider/supercollider.git "$SC_PATH"; then + echo "download.sh: git clone of SuperCollider failed" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi + if ! git -C "$SC_PATH" sparse-checkout set \ + include/plugin_interface include/common common SCVersion.txt; then + echo "download.sh: sparse checkout of SuperCollider headers failed" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi + fi +fi + +if [ ! -f "$SC_PATH/include/plugin_interface/SC_PlugIn.h" ]; then + echo "download.sh: SuperCollider plugin headers missing at $SC_PATH" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi +fi +if [ ! -f "$SC_PATH/SCVersion.txt" ]; then + echo "download.sh: SCVersion.txt missing at $SC_PATH" >&2 + if [ "${BASH_SOURCE[0]}" != "${0}" ]; then return 1; else exit 1; fi +fi + +echo "download.sh: dependency prefetch complete." +echo " SC_PATH=$SC_PATH" diff --git a/madskjeldgaard--portedplugins.c6/tests/executable b/madskjeldgaard--portedplugins.c6/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..cc457c8dce215feac8be36441abda16f14921d2b Binary files /dev/null and b/madskjeldgaard--portedplugins.c6/tests/executable differ diff --git a/madskjeldgaard--portedplugins.c6/tests/harbor_configure_apt_mirror.sh b/madskjeldgaard--portedplugins.c6/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/madskjeldgaard--portedplugins.c6/tests/harbor_prepare_download_env.sh b/madskjeldgaard--portedplugins.c6/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/madskjeldgaard--portedplugins.c6/tests/programgym_evaluator.py b/madskjeldgaard--portedplugins.c6/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/madskjeldgaard--portedplugins.c6/tests/programgym_task.json b/madskjeldgaard--portedplugins.c6/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..bc7283249941314ec9fa3bb537dfa6c4ee1e64a6 --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/programgym_task.json @@ -0,0 +1,266 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_lpg_golden_output.test_full_harness_output_matches_golden", + "eval.tests.test_lpg_golden_output.test_golden_registration_row_is_concrete", + "eval.tests.test_lpg_golden_output.test_golden_scenario_count_matches_live", + "eval.tests.test_lpg_output_contract.test_all_audio_rate_scenarios_emit_real_energy", + "eval.tests.test_lpg_output_contract.test_all_control_rate_scenarios_emit_real_energy", + "eval.tests.test_lpg_output_contract.test_every_scenario_output_is_finite", + "eval.tests.test_lpg_output_contract.test_harness_is_deterministic_across_runs", + "eval.tests.test_lpg_output_contract.test_harness_output_is_regenerated_not_stale", + "eval.tests.test_lpg_output_contract.test_zero_input_yields_zero_output", + "eval.tests.test_lpg_parameter_slop.test_audio_rate_scale_and_vca_change_output", + "eval.tests.test_lpg_parameter_slop.test_control_offset_changes_output", + "eval.tests.test_lpg_parameter_slop.test_control_scale_and_vca_change_output", + "eval.tests.test_lpg_parameter_slop.test_extreme_resonance_stays_bounded", + "eval.tests.test_lpg_parameter_slop.test_linearity_toggles_output_next_a", + "eval.tests.test_lpg_parameter_slop.test_linearity_toggles_output_next_k", + "eval.tests.test_lpg_parameter_slop.test_lowpass_mode_toggles_output_next_a", + "eval.tests.test_lpg_parameter_slop.test_lowpass_mode_toggles_output_next_k", + "eval.tests.test_lpg_parameter_slop.test_negative_control_input_distinct_and_stable", + "eval.tests.test_lpg_rate_dispatch.test_audio_path_output_matches_golden", + "eval.tests.test_lpg_rate_dispatch.test_control_path_output_matches_golden", + "eval.tests.test_lpg_rate_dispatch.test_control_rate_and_audio_rate_paths_both_run", + "eval.tests.test_lpg_rate_dispatch.test_next_k_and_next_a_produce_output_signal", + "eval.tests.test_lpg_rate_dispatch.test_rate_dispatch_changes_result_first_sample", + "eval.tests.test_lpg_registration.test_all_scenarios_present", + "eval.tests.test_lpg_registration.test_registered_name_is_lpg", + "eval.tests.test_lpg_registration.test_registers_unit_named_lpg", + "eval.tests.test_lpg_registration.test_unit_advertises_nonzero_alloc_size" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_executable_plugin.test_executable_exports_sc_plugin_entry_symbols", + "eval.tests.test_executable_plugin.test_executable_is_dynamically_loadable", + "eval.tests.test_executable_plugin.test_executable_is_elf_shared_object", + "eval.tests.test_lpg_dsp.test_control_circuit_clamps_to_saturation_range", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[-1.0-195093.078125]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[-10.0-34167760.0]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[-100.0-34167760.0]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[-5.0-34167760.0]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[0.0-143056.984375]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[1.0-111087.953125]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[10.0-1450.096191]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[20.0-1450.096191]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[5.0-3087.154053]", + "eval.tests.test_lpg_dsp.test_control_circuit_input_sweep[50.0-1450.096191]", + "eval.tests.test_lpg_dsp.test_control_offset_changes_output", + "eval.tests.test_lpg_dsp.test_control_offset_exact_rf_change", + "eval.tests.test_lpg_dsp.test_control_output_is_positive_resistance", + "eval.tests.test_lpg_dsp.test_control_positive_rf_exact", + "eval.tests.test_lpg_dsp.test_control_scale_changes_output", + "eval.tests.test_lpg_dsp.test_control_scale_exact_rf_change", + "eval.tests.test_lpg_dsp.test_driver_output_matches_golden", + "eval.tests.test_lpg_dsp.test_filter_extreme_resonance_exact_finite", + "eval.tests.test_lpg_dsp.test_filter_extreme_resonance_finite", + "eval.tests.test_lpg_dsp.test_filter_linearity_divergence", + "eval.tests.test_lpg_dsp.test_filter_linearity_exact_outputs", + "eval.tests.test_lpg_dsp.test_filter_lowpass_exact_outputs", + "eval.tests.test_lpg_dsp.test_filter_lowpass_on_off", + "eval.tests.test_lpg_dsp.test_filter_output_number_selection", + "eval.tests.test_lpg_dsp.test_filter_resistance_distinct", + "eval.tests.test_lpg_dsp.test_filter_resistance_exact_outputs", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[0-0.0]", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[1-0.23946]", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[2-0.754535]", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[3-0.319197]", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[4--0.333995]", + "eval.tests.test_lpg_dsp.test_filter_state_space_sequence[5-0.111415]", + "eval.tests.test_lpg_dsp.test_filter_vca_amount_distinct", + "eval.tests.test_lpg_dsp.test_filter_vca_exact_outputs", + "eval.tests.test_lpg_dsp.test_gate_control_scale_changes_output", + "eval.tests.test_lpg_dsp.test_gate_lowpass_off_changes_output", + "eval.tests.test_lpg_dsp.test_gate_lowpass_off_exact_divergence", + "eval.tests.test_lpg_dsp.test_gate_outputnum_changes_output", + "eval.tests.test_lpg_dsp.test_gate_outputnum_differentiator_exact", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[0-1.4e-05]", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[1-1.9e-05]", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[2-2.5e-05]", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[3-3.1e-05]", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[4-3.8e-05]", + "eval.tests.test_lpg_dsp.test_gate_signed_trajectory[5-4.6e-05]", + "eval.tests.test_lpg_dsp.test_gate_trajectory_monotonic_after_warmup", + "eval.tests.test_lpg_dsp.test_gate_vactrol_input_changes_output", + "eval.tests.test_lpg_dsp.test_gate_vactrolout_routing_exact", + "eval.tests.test_lpg_dsp.test_vactrol_fresh_instance_exact_value", + "eval.tests.test_lpg_dsp.test_vactrol_fresh_instance_has_reset_state", + "eval.tests.test_lpg_dsp.test_vactrol_samplerate_scaling", + "eval.tests.test_lpg_dsp.test_vactrol_samplerate_scaling_exact_steps", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[0-0.0]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[1-0.000311]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[10-0.029515]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[11-0.030061]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[2-0.001241]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[3-0.002789]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[4-0.005264]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[5-0.009605]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[6-0.015189]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[7-0.020451]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[8-0.024756]", + "eval.tests.test_lpg_dsp.test_vactrol_smoothing_trajectory[9-0.027779]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_dsp_behavior.TestAudioRateDSP.test_audio_control_and_linear_both_finite", + "eval.tests.test_dsp_behavior.TestAudioRateDSP.test_audio_lowpass_off_larger_than_on", + "eval.tests.test_dsp_behavior.TestControlRegionCoverage.test_large_control_and_hot_gate_are_distinct", + "eval.tests.test_dsp_behavior.TestControlRegionCoverage.test_new_regions_are_much_hotter_than_quiet_default", + "eval.tests.test_dsp_behavior.TestControlRegionCoverage.test_strong_gate_is_deterministic", + "eval.tests.test_dsp_behavior.TestControlRegionCoverage.test_strong_gate_never_blows_up", + "eval.tests.test_dsp_behavior.TestGateBehaviour.test_audio_rate_gate_open_produces_signal", + "eval.tests.test_dsp_behavior.TestGateBehaviour.test_closed_gate_is_much_quieter_than_open_gate", + "eval.tests.test_dsp_behavior.TestLinearity.test_linear_and_nonlinear_are_both_finite_and_close", + "eval.tests.test_dsp_behavior.TestLinearity.test_linearity_is_deterministic", + "eval.tests.test_dsp_behavior.TestLowpassMode.test_lowpass_off_output_is_much_larger_than_on", + "eval.tests.test_dsp_behavior.TestLowpassMode.test_lowpass_on_produces_finite_audible_output", + "eval.tests.test_dsp_behavior.TestVactrolParams.test_high_resonance_differs_from_low_resonance", + "eval.tests.test_dsp_behavior.TestVactrolParams.test_scaled_offset_determinism_with_equality", + "eval.tests.test_dsp_behavior.TestVactrolParams.test_scaled_offset_differs_from_scalar_default", + "eval.tests.test_dsp_behavior.TestVactrolParams.test_scaled_offset_golden_is_exact", + "eval.tests.test_harness_robustness.test_empty_executable_is_rejected", + "eval.tests.test_harness_robustness.test_harness_prints_no_stderr_on_success", + "eval.tests.test_harness_robustness.test_missing_executable_is_rejected", + "eval.tests.test_harness_robustness.test_non_elf_executable_is_rejected", + "eval.tests.test_harness_robustness.test_unknown_scenario_is_rejected", + "eval.tests.test_harness_robustness.test_zero_block_is_rejected", + "eval.tests.test_plugin_interface.TestDeterminism.test_different_block_sizes_scale_output_length", + "eval.tests.test_plugin_interface.TestDeterminism.test_repeated_run_is_bit_identical", + "eval.tests.test_plugin_interface.TestExecutableArtifact.test_api_version", + "eval.tests.test_plugin_interface.TestExecutableArtifact.test_executable_exists_and_is_elf", + "eval.tests.test_plugin_interface.TestExecutableArtifact.test_executable_is_dynamically_loadable", + "eval.tests.test_plugin_interface.TestExportedAbiSymbols.test_abi_symbols_are_stable_across_loads", + "eval.tests.test_plugin_interface.TestExportedAbiSymbols.test_api_version_symbol_exports_v6", + "eval.tests.test_plugin_interface.TestExportedAbiSymbols.test_load_symbol_is_exported", + "eval.tests.test_plugin_interface.TestExportedAbiSymbols.test_server_type_symbol_is_scsynth", + "eval.tests.test_plugin_interface.TestRateSelection.test_audio_and_control_paths_differ", + "eval.tests.test_plugin_interface.TestRateSelection.test_audio_rate_controlinput_is_labeled_audio", + "eval.tests.test_plugin_interface.TestRateSelection.test_control_rate_controlinput_is_labeled_control" + ] + }, + "generated_module_05": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_control_offset.test_negative_offset_mutes_the_open_unit", + "eval.tests.test_control_offset.test_nonnegative_offset_passes_signal", + "eval.tests.test_control_offset.test_offset_contrast_is_very_large", + "eval.tests.test_control_offset.test_offset_drives_clear_mute_to_pass_transition", + "eval.tests.test_control_offset.test_offset_outputs_are_finite_and_sane", + "eval.tests.test_dsp_inputs.test_distinct_parameters_drive_distinct_responses", + "eval.tests.test_dsp_inputs.test_nonzero_input_is_propagated", + "eval.tests.test_dsp_inputs.test_output_is_odd_in_input_polarity", + "eval.tests.test_dsp_inputs.test_parameters_bounded_by_filter_gain", + "eval.tests.test_dsp_inputs.test_zero_input_produces_exact_silence", + "eval.tests.test_filter_modes.test_audio_rate_control_path_is_more_open", + "eval.tests.test_filter_modes.test_audio_rate_linearity_mode_changes_output", + "eval.tests.test_filter_modes.test_linearity_outputs_are_finite", + "eval.tests.test_filter_modes.test_lowpass_off_changes_filter_response", + "eval.tests.test_filter_modes.test_lowpass_outputs_are_finite", + "eval.tests.test_gate_vactrol.test_closed_gate_mutes_but_does_not_fully_saturate", + "eval.tests.test_gate_vactrol.test_gate_control_opens_vactrol_increases_output", + "eval.tests.test_gate_vactrol.test_higher_gate_changes_response_more_than_once_per_step", + "eval.tests.test_gate_vactrol.test_open_gate_amplifies_relative_to_closed", + "eval.tests.test_plugin_load.test_plugin_load_registers_lpg_unit", + "eval.tests.test_plugin_load.test_plugin_load_registers_nonempty_unit_class", + "eval.tests.test_plugin_load.test_plugin_load_reports_scsynth_api_version", + "eval.tests.test_plugin_load.test_plugin_load_reports_server_type_scsynth", + "eval.tests.test_plugin_load.test_plugin_shared_module_is_present_in_branch", + "eval.tests.test_settled_open.test_first_open_block_is_just_opening", + "eval.tests.test_settled_open.test_settled_open_output_is_finite_and_bounded", + "eval.tests.test_settled_open.test_settled_open_reaches_high_steady_output", + "eval.tests.test_slope_transition.test_open_block_bounded_under_gain_limit", + "eval.tests.test_slope_transition.test_open_block_control_ramp_is_monotonic", + "eval.tests.test_slope_transition.test_open_block_ramps_from_closed_toward_open", + "eval.tests.test_vactrol_decay.test_closing_gate_does_not_instantly_mute_the_unit", + "eval.tests.test_vactrol_decay.test_decay_is_gradual_across_the_closing_block", + "eval.tests.test_vactrol_decay.test_open_memory_persists_versus_fresh_unit", + "eval.tests.test_vactrol_decay.test_release_envelope_is_finite_and_bounded" + ] + } + }, + "commit": "c6c0d7430e9bc8e8aaeae3db8263e1dbb8f398eb", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 2.0943662983361344, + "eval_clean_hashes": [ + "4141015d1a348c6433bc440c76100ff4ad9fb8f29ed7e5b1837cfe59cb4fb9a5" + ], + "input_record": { + "commit": "c6c0d7430e9bc8e8aaeae3db8263e1dbb8f398eb", + "full_name": "madskjeldgaard/portedplugins", + "input_joern_zip": "cpp_joern/madskjeldgaard__portedplugins.zip", + "joern_status": true, + "joern_time": 10.120234574889764, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "OSGeo/PROJ", + "rank": 923, + "similarity": 0.3872271478176117 + } + ], + "repo_path": "cpp/madskjeldgaard__portedplugins", + "source": "commit:c6c0d7430e9bc8e8aaeae3db8263e1dbb8f398eb", + "status": "done", + "url": "https://github.com/madskjeldgaard/portedplugins" + }, + "instance_id": "madskjeldgaard__portedplugins.c6c0d74", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 3, + "branch_name": "generated_module_01", + "iteration_limit": 10, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 10, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 10, + "branch_name": "generated_module_03", + "iteration_limit": 10, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 6, + "branch_name": "generated_module_04", + "iteration_limit": 10, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_05", + "iteration_limit": 10, + "module_index": 5, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "madskjeldgaard/portedplugins" +} diff --git a/madskjeldgaard--portedplugins.c6/tests/test.sh b/madskjeldgaard--portedplugins.c6/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/madskjeldgaard--portedplugins.c6/tests/workspace.tar.gz b/madskjeldgaard--portedplugins.c6/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5a2790cdf5d8d08e89e608e84c4d80535448c1ec --- /dev/null +++ b/madskjeldgaard--portedplugins.c6/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:beb2b01037473c250a2eac0ad00bb3dd3c0383388f830af74ceb48fdc4d71cd9 +size 9476 diff --git a/magefile--mage.0953947/environment/Dockerfile b/magefile--mage.0953947/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/magefile--mage.0953947/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/magefile--mage.0953947/environment/download.sh b/magefile--mage.0953947/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..18818279877b3460b10fc222ff4a770602ef6b48 --- /dev/null +++ b/magefile--mage.0953947/environment/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/magefile/mage + +go 1.18 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/magefile--mage.0953947/environment/executable b/magefile--mage.0953947/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..7dd9a38e24ff490c858a54a6ef8f7225c92faed3 --- /dev/null +++ b/magefile--mage.0953947/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d85ae2b20552de0171cb01775f0886eeff1b39bf45311ebfccffcde82ef681cb +size 6572712 diff --git a/magefile--mage.0953947/environment/programgym-go.tar.gz b/magefile--mage.0953947/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/magefile--mage.0953947/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/magefile--mage.0953947/environment/workspace.tar.gz b/magefile--mage.0953947/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c685230052dfc639253416eb1ef24ce01f25af6f --- /dev/null +++ b/magefile--mage.0953947/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89b67a0b462f9319a988fe73344228b7f7fe52f882020d1bb8f20592a7dac9e3 +size 1990 diff --git a/magefile--mage.0953947/instruction.md b/magefile--mage.0953947/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/magefile--mage.0953947/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/magefile--mage.0953947/solution/solve.sh b/magefile--mage.0953947/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/magefile--mage.0953947/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/magefile--mage.0953947/task.toml b/magefile--mage.0953947/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b3e1e92a19818f7a140cfac7f5b1679d0e9fae2c --- /dev/null +++ b/magefile--mage.0953947/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/magefile--mage.0953947" +description = "Synthetic ProgramGym cleanroom reconstruction task for magefile/mage" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "magefile__mage.0953947" +repository = "magefile/mage" +commit = "0953947c1673fd745a51c032aadeb3c63f9f3368" +language = "go" +difficulty = "easy" +difficulty_score = 1.8924841793646876 +test_branches = 3 +test_count = 275 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/magefile--mage.0953947/tests/Dockerfile b/magefile--mage.0953947/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/magefile--mage.0953947/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/magefile--mage.0953947/tests/blobs/tests/generated_module_01.tar.gz b/magefile--mage.0953947/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ae485232b8570660424ed123ee2259660ba25fa3 --- /dev/null +++ b/magefile--mage.0953947/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3110990c336fa38e86fb0d31d68e8eac13a51620f30364930f83463f6a1c9dd +size 18830 diff --git a/magefile--mage.0953947/tests/blobs/tests/generated_module_02.tar.gz b/magefile--mage.0953947/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..315f1ac5266b3c89e5fcac2e3578a83116453297 --- /dev/null +++ b/magefile--mage.0953947/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e93eb7f6173f415e526d0964fc372bbcf0801f608b775c89b7199e84138d8782 +size 10760 diff --git a/magefile--mage.0953947/tests/blobs/tests/generated_module_04.tar.gz b/magefile--mage.0953947/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..69b2a482592956a902a96c6e9d7053dcb7c8be6b --- /dev/null +++ b/magefile--mage.0953947/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06fc6afa901d848c61d1060cd67656a0fc6b63c39eece9860dff26cb9d68974c +size 10287 diff --git a/magefile--mage.0953947/tests/download.sh b/magefile--mage.0953947/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..18818279877b3460b10fc222ff4a770602ef6b48 --- /dev/null +++ b/magefile--mage.0953947/tests/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/magefile/mage + +go 1.18 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/magefile--mage.0953947/tests/executable b/magefile--mage.0953947/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..7dd9a38e24ff490c858a54a6ef8f7225c92faed3 --- /dev/null +++ b/magefile--mage.0953947/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d85ae2b20552de0171cb01775f0886eeff1b39bf45311ebfccffcde82ef681cb +size 6572712 diff --git a/magefile--mage.0953947/tests/programgym-go.tar.gz b/magefile--mage.0953947/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/magefile--mage.0953947/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/magefile--mage.0953947/tests/programgym_evaluator.py b/magefile--mage.0953947/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/magefile--mage.0953947/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/magefile--mage.0953947/tests/programgym_task.json b/magefile--mage.0953947/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..d505920c6ef8424d0b2494208310682355d2852a --- /dev/null +++ b/magefile--mage.0953947/tests/programgym_task.json @@ -0,0 +1,439 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_distinct_behaviors.test_list_lower_first_allcaps_prefix", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_distinct_behaviors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_basics.test_autocomplete_conflicts_with_command_flag[args0]", + "eval.tests.test_cli_basics.test_autocomplete_conflicts_with_command_flag[args1]", + "eval.tests.test_cli_basics.test_autocomplete_conflicts_with_command_flag[args2]", + "eval.tests.test_cli_basics.test_autocomplete_conflicts_with_command_flag[args3]", + "eval.tests.test_cli_basics.test_autocomplete_conflicts_with_command_flag[args4]", + "eval.tests.test_cli_basics.test_clean_with_arguments_conflicts", + "eval.tests.test_cli_basics.test_command_flags_are_mutually_exclusive_first_wins", + "eval.tests.test_cli_basics.test_debug_causes_debug_output", + "eval.tests.test_cli_basics.test_empty_dir_with_go_file_but_no_mage_tag", + "eval.tests.test_cli_basics.test_empty_help_flag_with_no_target_is_exit0", + "eval.tests.test_cli_basics.test_goos_goarch_accepted_with_compile", + "eval.tests.test_cli_basics.test_goos_goarch_require_compile[-goarch-amd64]", + "eval.tests.test_cli_basics.test_goos_goarch_require_compile[-goos-linux]", + "eval.tests.test_cli_basics.test_help_can_only_show_single_target", + "eval.tests.test_cli_basics.test_help_flag_prints_usage_exit0[--help]", + "eval.tests.test_cli_basics.test_help_flag_prints_usage_exit0[-h]", + "eval.tests.test_cli_basics.test_help_flag_prints_usage_exit0[-help]", + "eval.tests.test_cli_basics.test_help_lists_each_command_and_option", + "eval.tests.test_cli_basics.test_invalid_time_flag_parse_error", + "eval.tests.test_cli_basics.test_list_in_empty_dir_reports_error_exit1", + "eval.tests.test_cli_basics.test_no_magefiles_reports_error_exit1", + "eval.tests.test_cli_basics.test_unexpected_arguments_to_command", + "eval.tests.test_cli_basics.test_unknown_flag_is_error_exit2", + "eval.tests.test_cli_basics.test_version_exitcode_and_order", + "eval.tests.test_cli_basics.test_version_flag_takes_priority_over_list", + "eval.tests.test_cli_basics.test_version_output_shape", + "eval.tests.test_cli_basics.test_version_with_extra_argument_is_error", + "eval.tests.test_cli_distinct_behaviors.test_autocomplete_lower_first_allcaps_prefix", + "eval.tests.test_cli_distinct_behaviors.test_help_default_squashes_doc_newlines", + "eval.tests.test_cli_distinct_behaviors.test_help_multiline_retains_newlines", + "eval.tests.test_cli_distinct_behaviors.test_list_description_absent_without_package_comment", + "eval.tests.test_cli_distinct_behaviors.test_list_lower_first_allcaps_prefix", + "eval.tests.test_cli_distinct_behaviors.test_list_lower_first_allcaps_single_word", + "eval.tests.test_cli_distinct_behaviors.test_list_multiline_keeps_target_doc_never_squashed", + "eval.tests.test_cli_distinct_behaviors.test_list_shows_package_description", + "eval.tests.test_cli_distinct_behaviors.test_multiline_after_target_is_second_positional", + "eval.tests.test_cli_distinct_behaviors.test_run_allcaps_prefix_target", + "eval.tests.test_colors.test_color_disable_value_false", + "eval.tests.test_colors.test_color_disabled_by_default", + "eval.tests.test_colors.test_color_disabled_for_no_color_term", + "eval.tests.test_colors.test_color_enabled_uses_cyan_default", + "eval.tests.test_colors.test_invalid_target_color_falls_back_to_cyan", + "eval.tests.test_colors.test_target_color_case_insensitive", + "eval.tests.test_colors.test_target_color_selection[green-\\x1b[32m]", + "eval.tests.test_colors.test_target_color_selection[red-\\x1b[31m]", + "eval.tests.test_colors.test_target_color_selection[yellow-\\x1b[33m]", + "eval.tests.test_compile_static.test_compile_accepts_ldflags", + "eval.tests.test_compile_static.test_compile_does_not_run_target", + "eval.tests.test_compile_static.test_compile_exit0_and_stderr_empty", + "eval.tests.test_compile_static.test_compile_missing_output_path_is_flag_error_exit2", + "eval.tests.test_compile_static.test_compile_out_respects_keep_of_binary_name_in_help", + "eval.tests.test_compile_static.test_compile_produces_executable", + "eval.tests.test_compile_static.test_compile_with_goos_goarch_accepted", + "eval.tests.test_compile_static.test_compiled_binary_is_runnable", + "eval.tests.test_completion.test_install_config_dir_completions", + "eval.tests.test_completion.test_install_fish_invalid_xdg_write_error[parent-is-file-not a directory]", + "eval.tests.test_completion.test_install_fish_invalid_xdg_write_error[xdg-is-file-not a directory]", + "eval.tests.test_completion.test_install_fish_overwrites_existing_script", + "eval.tests.test_completion.test_install_fish_script_autocomplete_line", + "eval.tests.test_completion.test_install_fish_script_embeds_real_executable", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l autocomplete -d 'print target names for shell completion']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l clean -d 'clean out old generated binaries from CACHE_DIR']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l compile -r -F -d 'output a static binary to the given path']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l debug -d 'turn on debug messages']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l goarch -r -d 'set GOARCH for binary produced with -compile']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l gocmd -r -d 'use the given go binary to compile the output']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l goos -r -d 'set GOOS for binary produced with -compile']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l init -d 'create a starting template if no mage files exist']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l install -r -a 'bash zsh fish powershell pwsh' -d 'install shell completion']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l keep -d 'keep intermediate mage files around after running']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l ldflags -r -d 'set ldflags for binary produced with -compile']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l multiline -d 'retain line returns in help text']", + "eval.tests.test_completion.test_install_fish_script_has_long_flag_lines[complete -c mage -l version -d 'show version info for the mage binary']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s d -r -F -d 'directory to read magefiles from']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s f -d 'force recreation of compiled magefile']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s h -d 'show this help']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s l -d 'list mage targets in this directory']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s t -r -d 'timeout in duration parsable format']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s v -d 'show verbose output when running mage targets']", + "eval.tests.test_completion.test_install_fish_script_has_short_flag_lines[complete -c mage -s w -r -F -d 'working directory where magefiles will run']", + "eval.tests.test_completion.test_install_fish_script_trailing_newline", + "eval.tests.test_completion.test_install_fish_shell_case_insensitive", + "eval.tests.test_completion.test_install_fish_without_xdg_uses_home_config_dir", + "eval.tests.test_completion.test_install_fish_writes_script_to_xdg", + "eval.tests.test_completion.test_install_powershell_case_insensitive_host_conditional", + "eval.tests.test_completion.test_install_shell_normalizes_whitespace_case_via_xdg", + "eval.tests.test_completion.test_install_shell_pad_tabs_and_case_via_xdg", + "eval.tests.test_completion.test_install_unsupported_shell_is_error[csh]", + "eval.tests.test_completion.test_install_unsupported_shell_is_error[nosuch]", + "eval.tests.test_completion.test_install_unsupported_shell_is_error[tcsh]", + "eval.tests.test_completion.test_install_unsupported_shell_is_error[xsh]", + "eval.tests.test_completion.test_install_whitespace_only_case_fold_is_unsupported", + "eval.tests.test_completion.test_install_whitespace_only_shell_is_unsupported", + "eval.tests.test_help_target.test_help_target_case_insensitive", + "eval.tests.test_help_target.test_help_target_lists_aliases", + "eval.tests.test_help_target.test_help_target_prints_comment_and_usage", + "eval.tests.test_help_target.test_help_target_with_required_args_in_usage", + "eval.tests.test_help_target.test_help_unknown_or_namespace_target_is_exit2[Namespace:Run]", + "eval.tests.test_help_target.test_help_unknown_or_namespace_target_is_exit2[favicon]", + "eval.tests.test_help_target.test_help_unknown_or_namespace_target_is_exit2[ns.run]", + "eval.tests.test_help_target.test_help_unknown_target_is_exit2", + "eval.tests.test_help_target.test_help_with_no_target_prints_full_usage", + "eval.tests.test_init_clean.test_clean_empty_cache_reports_cleaned", + "eval.tests.test_init_clean.test_clean_keeps_subdirectories", + "eval.tests.test_init_clean.test_clean_missing_cache_is_noop", + "eval.tests.test_init_clean.test_clean_removes_files_in_cache", + "eval.tests.test_init_clean.test_clean_reports_did_not_ignore_default_cache", + "eval.tests.test_init_clean.test_init_creates_magefile_template", + "eval.tests.test_init_clean.test_init_idempotent_overwrites_template", + "eval.tests.test_init_clean.test_init_template_has_no_error_on_stdout", + "eval.tests.test_list_autocomplete.test_autocomplete_empty_dir_is_error_exit1", + "eval.tests.test_list_autocomplete.test_autocomplete_includes_aliases", + "eval.tests.test_list_autocomplete.test_autocomplete_lowercases_names", + "eval.tests.test_list_autocomplete.test_autocomplete_prints_one_target_per_line", + "eval.tests.test_list_autocomplete.test_autocomplete_sorted_and_no_duplicates", + "eval.tests.test_list_autocomplete.test_list_headers_and_sorted_targets", + "eval.tests.test_list_autocomplete.test_list_marks_default_target_with_star", + "eval.tests.test_list_autocomplete.test_list_shows_doc_synopsis_from_comment", + "eval.tests.test_list_autocomplete.test_list_without_default_target_no_star", + "eval.tests.test_magefiles_dir.test_autocomplete_from_magefiles_dir", + "eval.tests.test_magefiles_dir.test_both_magefiles_dir_and_root_files_warns", + "eval.tests.test_magefiles_dir.test_list_from_magefiles_dir", + "eval.tests.test_magefiles_dir.test_run_target_from_magefiles_dir", + "eval.tests.test_target_run.test_keep_retains_generated_mainfile", + "eval.tests.test_target_run.test_mainfile_removed_without_keep", + "eval.tests.test_target_run.test_run_alias_maps_to_target", + "eval.tests.test_target_run.test_run_default_target", + "eval.tests.test_target_run.test_run_failing_target_exit1_and_error", + "eval.tests.test_target_run.test_run_gocmd_nonexistent_binary_is_error_exit1", + "eval.tests.test_target_run.test_run_multiple_targets_in_one_invocation", + "eval.tests.test_target_run.test_run_named_target", + "eval.tests.test_target_run.test_run_namespace_dot_target_unknown_exit2", + "eval.tests.test_target_run.test_run_target_case_insensitive", + "eval.tests.test_target_run.test_run_target_missing_required_args", + "eval.tests.test_target_run.test_run_target_with_positional_args", + "eval.tests.test_target_run.test_run_unknown_target_exit2", + "eval.tests.test_target_run.test_run_various_targets[goodbye]", + "eval.tests.test_target_run.test_run_various_targets[hello]", + "eval.tests.test_target_run.test_run_various_targets[silent]", + "eval.tests.test_target_run.test_run_verbose_prints_running_target", + "eval.tests.test_target_run.test_run_workdir_nonexistent_is_error_exit1", + "eval.tests.test_target_run.test_timeout_via_t_flag_cancels_slow_target", + "eval.tests.test_target_run.test_timeout_via_w_env_cancels_slow_target", + "eval.tests.test_target_run.test_workdir_defaults_to_project_dir", + "eval.tests.test_target_run.test_workdir_override_via_w" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_parse_autocomplete.TestAutocomplete.test_includes_alias_names", + "eval.tests.test_parse_autocomplete.TestAutocomplete.test_includes_namespaced_targets", + "eval.tests.test_parse_autocomplete.TestAutocomplete.test_lists_all_target_names_sorted", + "eval.tests.test_parse_autocomplete.TestAutocomplete.test_no_duplicates_in_autocomplete", + "eval.tests.test_parse_errors.TestAliasErrors.test_alias_with_non_string_key_ignored", + "eval.tests.test_parse_errors.TestAliasErrors.test_malformed_alias_value_is_skipped", + "eval.tests.test_parse_errors.TestAliasErrors.test_valid_alias_does_not_fail_parse", + "eval.tests.test_parse_errors.TestDuplicateTargets.test_case_insensitive_duplicate_rejected", + "eval.tests.test_parse_errors.TestDuplicateTargets.test_duplicate_in_same_file_rejected", + "eval.tests.test_parse_errors.TestDuplicateTargets.test_duplicate_message_lists_conflicting_names", + "eval.tests.test_parse_errors.TestImportErrors.test_duplicate_target_across_import_fails", + "eval.tests.test_parse_errors.TestImportErrors.test_invalid_import_path_fails", + "eval.tests.test_parse_errors.TestMultiplePackages.test_missing_directory_reports_parse_error", + "eval.tests.test_parse_errors.TestMultiplePackages.test_no_magefiles_error", + "eval.tests.test_parse_errors.TestMultiplePackages.test_two_packages_in_directory_fails", + "eval.tests.test_parse_errors.TestSkippedTargets.test_bad_return_types_all_skipped_empty_list", + "eval.tests.test_parse_errors.TestSkippedTargets.test_context_and_error_targets_still_listed", + "eval.tests.test_parse_execute.TestOptionalArgs.test_bool_optional_bare_flag", + "eval.tests.test_parse_execute.TestOptionalArgs.test_int_optional_conversion_error", + "eval.tests.test_parse_execute.TestOptionalArgs.test_nonbool_optional_requires_equals", + "eval.tests.test_parse_execute.TestOptionalArgs.test_optional_args_default_to_nil", + "eval.tests.test_parse_execute.TestOptionalArgs.test_optional_flags_are_set_via_equals", + "eval.tests.test_parse_execute.TestOptionalArgs.test_unknown_optional_flag_fails", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_bool_arg_parses_true_false", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_bool_conversion_failure_exits_2", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_duration_conversion_failure_exits_2", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_float_conversion_failure_exits_2", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_int_conversion_failure_exits_2", + "eval.tests.test_parse_execute.TestRequiredArgParsing.test_run_all_typed_required_args", + "eval.tests.test_parse_execute.TestRunTargets.test_run_error_target_fails_with_message", + "eval.tests.test_parse_execute.TestRunTargets.test_run_simple_void_target", + "eval.tests.test_parse_execute.TestRunTargets.test_run_unknown_target_fails", + "eval.tests.test_parse_help.TestHelpBasics.test_help_requires_positional_after_flag", + "eval.tests.test_parse_help.TestHelpBasics.test_help_shows_doc_comment", + "eval.tests.test_parse_help.TestHelpBasics.test_help_target_is_case_insensitive", + "eval.tests.test_parse_help.TestHelpErrors.test_help_multiple_targets_rejected", + "eval.tests.test_parse_help.TestHelpErrors.test_help_without_target_prints_main_help", + "eval.tests.test_parse_help.TestHelpErrors.test_unknown_target_help_fails", + "eval.tests.test_parse_help.TestHelpUsageLine.test_flag_comment_alignment", + "eval.tests.test_parse_help.TestHelpUsageLine.test_multiple_optional_args_collapse_to_flags", + "eval.tests.test_parse_help.TestHelpUsageLine.test_optional_all_args_no_required", + "eval.tests.test_parse_help.TestHelpUsageLine.test_optional_single_arg_shows_flag", + "eval.tests.test_parse_help.TestHelpUsageLine.test_required_string_arg_in_usage", + "eval.tests.test_parse_list.TestAliases.test_alias_function_marked_via_help", + "eval.tests.test_parse_list.TestAliases.test_alias_help_shows_aliases_section", + "eval.tests.test_parse_list.TestCaseInsensitivity.test_target_name_lowercases_only_first_word", + "eval.tests.test_parse_list.TestDefaultTarget.test_default_target_marked_with_star", + "eval.tests.test_parse_list.TestDefaultTarget.test_default_var_with_non_exported_nil_value_is_ignored", + "eval.tests.test_parse_list.TestDefaultTarget.test_no_default_when_Default_var_absent", + "eval.tests.test_parse_list.TestDescription.test_multiline_tag_preserves_description_lines", + "eval.tests.test_parse_list.TestDescription.test_no_description_when_no_package_doc", + "eval.tests.test_parse_list.TestDescription.test_package_doc_becomes_list_header", + "eval.tests.test_parse_list.TestImports.test_import_notext_targets_use_second_file", + "eval.tests.test_parse_list.TestImports.test_imported_alias_namespaces_targets", + "eval.tests.test_parse_list.TestImports.test_imported_package_aliases_not_surfaced", + "eval.tests.test_parse_list.TestImports.test_imported_targets_are_added_to_list", + "eval.tests.test_parse_list.TestListTargets.test_list_rows_carry_name_and_synopsis", + "eval.tests.test_parse_list.TestListTargets.test_simple_target_appears", + "eval.tests.test_parse_list.TestListTargets.test_string_return_function_is_skipped", + "eval.tests.test_parse_list.TestListTargets.test_synopsis_is_trimmed_to_first_sentence", + "eval.tests.test_parse_list.TestListTargets.test_unexported_helper_is_not_a_target", + "eval.tests.test_parse_list.TestNamespaces.test_namespace_methods_become_subcommand_targets", + "eval.tests.test_parse_list.TestNamespaces.test_namespace_name_is_case_insensitive_lowercased", + "eval.tests.test_parse_list.TestNamespaces.test_non_namespace_type_methods_are_ignored", + "eval.tests.test_parse_list.TestNamespaces.test_plain_namespace_target", + "eval.tests.test_parse_list.TestSynopsisSanitization.test_backtick_replaced_in_comment", + "eval.tests.test_parse_list.TestSynopsisSanitization.test_repeating_name_removed_from_synopsis" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_sh_and_internal.test_binary_cmdran_false_path_then_exit", + "eval.tests.test_sh_and_internal.test_binary_cmdran_true_on_success", + "eval.tests.test_sh_and_internal.test_binary_exitstatus_nonzero_check", + "eval.tests.test_sh_and_internal.test_binary_exitstatus_success_is_zero", + "eval.tests.test_sh_and_internal.test_internal_bad_gocmd_version_error", + "eval.tests.test_sh_and_internal.test_internal_compile_error_messages", + "eval.tests.test_sh_and_internal.test_internal_debug_compile_succeeds", + "eval.tests.test_sh_and_internal.test_internal_empty_magefile_dir_lists_no_targets", + "eval.tests.test_sh_and_internal.test_internal_envwithgoos_and_outputdebug_compile", + "eval.tests.test_sh_and_internal.test_internal_help_flag_succeeds", + "eval.tests.test_sh_and_internal.test_internal_listing_exercises_splitenv", + "eval.tests.test_sh_and_internal.test_internal_version_flag_succeeds", + "eval.tests.test_sh_and_internal.test_sh_cmdran_nil_is_true", + "eval.tests.test_sh_and_internal.test_sh_cmdran_on_fatal_error_is_false", + "eval.tests.test_sh_and_internal.test_sh_copy_missing_source_errors", + "eval.tests.test_sh_and_internal.test_sh_copy_missing_source_propagates_error", + "eval.tests.test_sh_and_internal.test_sh_copy_overwrites_existing_dest", + "eval.tests.test_sh_and_internal.test_sh_copy_roundtrip_content_and_mode", + "eval.tests.test_sh_and_internal.test_sh_exec_env_map_overrides_os_env", + "eval.tests.test_sh_and_internal.test_sh_exec_expands_env_in_arguments", + "eval.tests.test_sh_and_internal.test_sh_exec_expands_env_in_command_position", + "eval.tests.test_sh_and_internal.test_sh_exec_failing_command_ran_true_error_not_nil", + "eval.tests.test_sh_and_internal.test_sh_exec_inherits_os_env_for_unknown_var", + "eval.tests.test_sh_and_internal.test_sh_exec_nil_stdout_writer_is_discarded", + "eval.tests.test_sh_and_internal.test_sh_exec_ran_flag_true_on_success", + "eval.tests.test_sh_and_internal.test_sh_exec_raw_output_not_trimmed", + "eval.tests.test_sh_and_internal.test_sh_exec_routes_stdout_and_stderr_to_writers", + "eval.tests.test_sh_and_internal.test_sh_exitstatus_fatal_error_returns_its_code", + "eval.tests.test_sh_and_internal.test_sh_exitstatus_nil_is_zero", + "eval.tests.test_sh_and_internal.test_sh_exitstatus_plain_error_is_one", + "eval.tests.test_sh_and_internal.test_sh_outcmd_appended_args_and_error", + "eval.tests.test_sh_and_internal.test_sh_outcmd_failure_exit_code", + "eval.tests.test_sh_and_internal.test_sh_outcmd_returns_output", + "eval.tests.test_sh_and_internal.test_sh_output_empty_stdout", + "eval.tests.test_sh_and_internal.test_sh_output_failure_empty_output_returns_empty", + "eval.tests.test_sh_and_internal.test_sh_output_failure_exit_code_when_propagated", + "eval.tests.test_sh_and_internal.test_sh_output_failure_returns_partial_output_and_error", + "eval.tests.test_sh_and_internal.test_sh_output_multiline_interior_newlines_preserved", + "eval.tests.test_sh_and_internal.test_sh_output_single_line_trimmed", + "eval.tests.test_sh_and_internal.test_sh_output_trims_single_trailing_newline", + "eval.tests.test_sh_and_internal.test_sh_outputwith_empty_env_map_uses_inherited", + "eval.tests.test_sh_and_internal.test_sh_outputwith_trims_and_applies_env", + "eval.tests.test_sh_and_internal.test_sh_rm_missing_path_returns_nil", + "eval.tests.test_sh_and_internal.test_sh_rm_removes_file", + "eval.tests.test_sh_and_internal.test_sh_rm_removes_nonempty_directory", + "eval.tests.test_sh_and_internal.test_sh_run_command_not_found", + "eval.tests.test_sh_and_internal.test_sh_run_exit_code_propagation_matrix[1]", + "eval.tests.test_sh_and_internal.test_sh_run_exit_code_propagation_matrix[3]", + "eval.tests.test_sh_and_internal.test_sh_run_exit_code_propagation_matrix[42]", + "eval.tests.test_sh_and_internal.test_sh_run_exit_code_propagation_matrix[9]", + "eval.tests.test_sh_and_internal.test_sh_run_failure_propagates_exit_code", + "eval.tests.test_sh_and_internal.test_sh_run_multiple_args_joined_in_error", + "eval.tests.test_sh_and_internal.test_sh_run_multiword_arg_verbose_quotes", + "eval.tests.test_sh_and_internal.test_sh_run_success_exit_zero", + "eval.tests.test_sh_and_internal.test_sh_run_verbose_prints_stdout_and_exec_log", + "eval.tests.test_sh_and_internal.test_sh_runcmd_baked_and_appended_args", + "eval.tests.test_sh_and_internal.test_sh_runcmd_called_multiple_times", + "eval.tests.test_sh_and_internal.test_sh_runv_failure_exit_code", + "eval.tests.test_sh_and_internal.test_sh_runv_prints_to_stdout_without_verbose", + "eval.tests.test_sh_and_internal.test_sh_runwith_env_visible_in_output", + "eval.tests.test_sh_and_internal.test_sh_runwith_failure_exit_code", + "eval.tests.test_sh_and_internal.test_sh_runwith_override_inherited_env", + "eval.tests.test_sh_and_internal.test_sh_runwith_sets_environment", + "eval.tests.test_sh_and_internal.test_sh_runwithv_env_and_stdout" + ] + } + }, + "commit": "0953947c1673fd745a51c032aadeb3c63f9f3368", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.8924841793646876, + "eval_clean_hashes": [ + "d85ae2b20552de0171cb01775f0886eeff1b39bf45311ebfccffcde82ef681cb" + ], + "input_record": { + "commit": "0953947c1673fd745a51c032aadeb3c63f9f3368", + "commits": 234, + "contributors": 69, + "difficulty": "easy", + "difficulty_code_lines": 7807, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 7807, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.8924841793646876, + "difficulty_test_code_lines": 5674, + "full_name": "magefile/mage", + "github_stars": 4688, + "input_joern_zip": "go_joern/magefile__mage.zip", + "joern_status": true, + "joern_time": 26.482023026095703, + "language": "go", + "pb_match": [ + { + "pb_fullname": "go-critic/go-critic", + "rank": 860, + "similarity": 0.5070809125900269 + }, + { + "pb_fullname": "mibk/dupl", + "rank": 328, + "similarity": 0.5524193048477173 + }, + { + "pb_fullname": "mgechev/revive", + "rank": 419, + "similarity": 0.5490899085998535 + }, + { + "pb_fullname": "mfridman/tparse", + "rank": 346, + "similarity": 0.5419175624847412 + }, + { + "pb_fullname": "cweill/gotests", + "rank": 123, + "similarity": 0.5940353870391846 + }, + { + "pb_fullname": "incu6us/goimports-reviser", + "rank": 454, + "similarity": 0.5093631744384766 + }, + { + "pb_fullname": "kyoh86/richgo", + "rank": 183, + "similarity": 0.5706510543823242 + }, + { + "pb_fullname": "psampaz/go-mod-outdated", + "rank": 366, + "similarity": 0.4948729872703552 + }, + { + "pb_fullname": "kisielk/errcheck", + "rank": 630, + "similarity": 0.5447461009025574 + }, + { + "pb_fullname": "hairyhenderson/gomplate", + "rank": 458, + "similarity": 0.528952419757843 + }, + { + "pb_fullname": "tomarrell/wrapcheck", + "rank": 507, + "similarity": 0.5126895904541016 + } + ], + "repo_age": 8.87, + "repo_path": "go/magefile__mage", + "source": "commit:0953947c1673fd745a51c032aadeb3c63f9f3368", + "status": "done", + "url": "https://github.com/magefile/mage" + }, + "instance_id": "magefile__mage.0953947", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "magefile/mage" +} diff --git a/magefile--mage.0953947/tests/test.sh b/magefile--mage.0953947/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/magefile--mage.0953947/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/magefile--mage.0953947/tests/workspace.tar.gz b/magefile--mage.0953947/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c685230052dfc639253416eb1ef24ce01f25af6f --- /dev/null +++ b/magefile--mage.0953947/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89b67a0b462f9319a988fe73344228b7f7fe52f882020d1bb8f20592a7dac9e3 +size 1990 diff --git a/magic-akari--ncmc.4faead9/environment/Dockerfile b/magic-akari--ncmc.4faead9/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/magic-akari--ncmc.4faead9/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/magic-akari--ncmc.4faead9/environment/download.sh b/magic-akari--ncmc.4faead9/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a2a8662a448aff549da22be44a1d17a9fcbce3d --- /dev/null +++ b/magic-akari--ncmc.4faead9/environment/download.sh @@ -0,0 +1,1803 @@ +#!/usr/bin/env bash +# ProgramGym download.sh for magic-akari/ncmc (Rust workspace). +# Stage 1 (networked): regenerate a self-contained workspace manifest tree in a +# temp dir using inline heredocs, embed the exact locked resolution, and run one +# explicit `cargo fetch --manifest-path` against that generated root manifest. +# This fills the shared cargo registry cache with every crate version the offline +# Stage 2 build needs. It performs NO build, link, test, or packaging step. +# Source-safe: exported env vars persist in the current shell; no `exit` in normal flow. + +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + SOURCED=1 +else + SOURCED=0 +fi + +warn_fail() { + echo "download.sh: error: $*" >&2 + if [ "$SOURCED" = "1" ]; then + return 1 + else + exit 1 + fi +} + +GEN="${TMPDIR:-/tmp}/ncmc_depgen" +rm -rf "$GEN" +mkdir -p "$GEN/crates/ncm_core/src" +mkdir -p "$GEN/crates/ncm_meta/src" +mkdir -p "$GEN/crates/ncmc/src" +mkdir -p "$GEN/crates/ncmc_wasm/src" + +cat > "$GEN/Cargo.toml" <<'PBTOML' +[workspace] +members = ["crates/*"] +resolver = "2" + + [workspace.package] + authors = ["magic-akari "] + edition = "2021" + homepage = "https://github.com/magic-akari/ncmc" + license = "MIT" + readme = "README.md" + repository = "https://github.com/magic-akari/ncmc" + version = "0.2.11" + + [workspace.dependencies] + ncm_core = { version = "0.2.11", path = "crates/ncm_core" } + ncm_meta = { version = "0.2.11", path = "crates/ncm_meta" } + + aes = "0.8.4" + anyhow = "1.0.89" + base64 = "0.22.1" + bpaf = "0.9" + ecb = "0.1.2" + id3 = "1.14.0" + js-sys = "0.3.70" + metaflac = "0.2.7" + miniserde = "0.1" + serde-wasm-bindgen = "0.6" + testing = "0.42.0" + wasm-bindgen = "0.2.93" + +[profile.release] +lto = true +panic = "abort" +strip = "debuginfo" +PBTOML + +cat > "$GEN/crates/ncm_core/Cargo.toml" <<'PBTOML' +[package] +name = "ncm_core" + +description = "core decoder for ncmc" +keywords = ["ncm", "ncmc", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + +[dependencies] +aes = { workspace = true } +anyhow = { workspace = true } +base64 = { workspace = true } +ecb = { workspace = true } +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncm_core/src/lib.rs" + +cat > "$GEN/crates/ncm_meta/Cargo.toml" <<'PBTOML' +[package] +name = "ncm_meta" + +description = "music meta utils for ncmc" +keywords = ["ncm", "ncmc", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + +[dependencies] +anyhow = { workspace = true } +id3 = { workspace = true } +metaflac = { workspace = true } +miniserde = { workspace = true } +ncm_core = { workspace = true } + +[dev-dependencies] +testing = { workspace = true } +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncm_meta/src/lib.rs" + +cat > "$GEN/crates/ncmc/Cargo.toml" <<'PBTOML' +[package] +name = "ncmc" + +description = "convert encrypted ncm file to original music file." +keywords = ["ncm", "ncmc", "cli", "converter", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + + +[dependencies] +anyhow = { workspace = true } +bpaf = { workspace = true, features = ["derive"] } +ncm_core = { workspace = true } +ncm_meta = { workspace = true } + +[dev-dependencies] +testing = { workspace = true } +PBTOML +printf 'fn main() {}\n' > "$GEN/crates/ncmc/src/main.rs" + +cat > "$GEN/crates/ncmc_wasm/Cargo.toml" <<'PBTOML' +[package] +name = "ncmc_wasm" + +description = "convert encrypted ncm file to original music file." +keywords = ["ncm", "ncmc", "converter", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + + +[dependencies] +anyhow = { workspace = true } +js-sys = { workspace = true } +ncm_core = { workspace = true } +ncm_meta = { workspace = true } +serde-wasm-bindgen = { workspace = true } +wasm-bindgen = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncmc_wasm/src/lib.rs" + +cat > "$GEN/Cargo.lock" <<'PBLOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "ast_node" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d23a6d1d5f18bdbc06d9aa908880e5f49205156ba804751af731c51f5cf81a" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.91", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "better_scoped_tls" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297b153aa5e573b5863108a6ddc9d5c968bd0b20e75cc614ee9821d2f45679c7" +dependencies = [ + "scoped-tls", +] + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bpaf" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50fd5174866dc2fa2ddc96e8fb800852d37f064f32a45c7b7c2f8fa2c64c77fa" +dependencies = [ + "bpaf_derive", +] + +[[package]] +name = "bpaf_derive" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf95d9c7e6aba67f8fc07761091e93254677f4db9e27197adecebc7039a58722" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "ecb" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a8bfa975b1aec2145850fcaa1c6fe269a16578c44705a532ae3edc92b8881c7" +dependencies = [ + "cipher", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "from_variant" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d8947525c49c73130b5a7187b55b027b6b78fe60268d9f4c283ed690698cb1" +dependencies = [ + "proc-macro2", + "swc_macros_common", + "syn 2.0.91", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hstr" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" +dependencies = [ + "hashbrown", + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "triomphe", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "id3" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1df50e6c625115513974d5efc34c4bc55524145e14cb2297e909ab5ece0d49" +dependencies = [ + "bitflags", + "byteorder", + "flate2", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "metaflac" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f083edae4a21f5acb1fda8220d1c14fa31f725bfd4e21005a14c2d8944db9b" +dependencies = [ + "byteorder", + "hex", +] + +[[package]] +name = "miette" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "mini-internal" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07b7f1340a7f0d2f89755aac4096f1c55352bfcb95cb8f351d6fcefa18df474f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "miniserde" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625208b7bc90255fe6d99338041880bf48a3049166f46fbefbd4e9b0478c0b66" +dependencies = [ + "itoa", + "mini-internal", + "ryu", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +dependencies = [ + "adler2", +] + +[[package]] +name = "ncm_core" +version = "0.2.11" +dependencies = [ + "aes", + "anyhow", + "base64", + "ecb", +] + +[[package]] +name = "ncm_meta" +version = "0.2.11" +dependencies = [ + "anyhow", + "id3", + "metaflac", + "miniserde", + "ncm_core", + "testing", +] + +[[package]] +name = "ncmc" +version = "0.2.11" +dependencies = [ + "anyhow", + "bpaf", + "ncm_core", + "ncm_meta", + "testing", +] + +[[package]] +name = "ncmc_wasm" +version = "0.2.11" +dependencies = [ + "anyhow", + "js-sys", + "ncm_core", + "ncm_meta", + "serde-wasm-bindgen", + "wasm-bindgen", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "serde_json" +version = "1.0.134" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "swc_allocator" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76aa0eb65c0f39f9b6d82a7e5192c30f7ac9a78f084a21f270de1d8c600ca388" +dependencies = [ + "bumpalo", + "hashbrown", + "ptr_meta", + "rustc-hash", + "triomphe", +] + +[[package]] +name = "swc_atoms" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b25ff0f3fd48ab1a95d86fd0505fdd1ac904f84d0350dc8222bbc824e9d4fdf6" +dependencies = [ + "hstr", + "once_cell", + "rustc-hash", + "serde", +] + +[[package]] +name = "swc_common" +version = "0.40.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca32839a37f3b12213b18623b1bd58d37641cab750c50c3c287876cb98b12ab4" +dependencies = [ + "ast_node", + "better_scoped_tls", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "parking_lot", + "rustc-hash", + "serde", + "siphasher", + "swc_allocator", + "swc_atoms", + "swc_eq_ignore_macros", + "swc_visit", + "termcolor", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "swc_eq_ignore_macros" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "swc_error_reporters" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f9286183c9be40aafcbbe8c397403fb32af812a3dffe93eee9067aee4fbedb" +dependencies = [ + "anyhow", + "miette", + "once_cell", + "parking_lot", + "swc_common", +] + +[[package]] +name = "swc_macros_common" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e18fbfe83811ffae2bb23727e45829a0d19c6870bced7c0f545cc99ad248dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "swc_visit" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" +dependencies = [ + "either", + "new_debug_unreachable", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "testing" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9217860da21fabe9c65981ba42f6dad2bd8f463b670448afe79aa9d50f0bc137" +dependencies = [ + "ansi_term", + "cargo_metadata", + "difference", + "once_cell", + "pretty_assertions", + "regex", + "serde", + "serde_json", + "swc_common", + "swc_error_reporters", + "testing_macros", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "testing_macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39660370116afe46d5ff8bcb01b7afe2140dda3137ef5cb1914681e37a4ee06" +dependencies = [ + "anyhow", + "glob", + "once_cell", + "proc-macro2", + "quote", + "regex", + "relative-path", + "syn 2.0.91", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "triomphe" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" +dependencies = [ + "serde", + "stable_deref_trait", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.91", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] +PBLOCK + +# Populate the shared registry cache with the exact locked resolution, using an +# explicit generated manifest path (never the repo root or /source_ro). +if ! cargo fetch --locked --manifest-path "$GEN/Cargo.toml"; then + # NOTE: the message wording is chosen not to echo the command token sequence + # back into the diagnostic, keeping the generated script unambiguous. + warn_fail "dependency prefetch (locked, generated manifest) failed; registry cache not populated" +fi + +# Nothing is built, linked, tested, packaged, or installed by this stage. +echo "download.sh: dependency prefetch complete." diff --git a/magic-akari--ncmc.4faead9/environment/executable b/magic-akari--ncmc.4faead9/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..b2a5e5b8c74825be476f1c3adc7f4b75d899e888 --- /dev/null +++ b/magic-akari--ncmc.4faead9/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdd50802f417a1a6637e9109d83575660e11ce029465cf15f50c79e222d74516 +size 994488 diff --git a/magic-akari--ncmc.4faead9/environment/harbor_prepare_download_env.sh b/magic-akari--ncmc.4faead9/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/magic-akari--ncmc.4faead9/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/magic-akari--ncmc.4faead9/environment/workspace.tar.gz b/magic-akari--ncmc.4faead9/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4052f84aaa2aef22fa55f5f0c65e93acbe35a5a0 --- /dev/null +++ b/magic-akari--ncmc.4faead9/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d8aee9c8bdac8387d5e62689ac110d8c5cfa99ae452e765bf11c39113fbbcad +size 230 diff --git a/magic-akari--ncmc.4faead9/instruction.md b/magic-akari--ncmc.4faead9/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/magic-akari--ncmc.4faead9/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/magic-akari--ncmc.4faead9/solution/solve.sh b/magic-akari--ncmc.4faead9/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/magic-akari--ncmc.4faead9/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/magic-akari--ncmc.4faead9/task.toml b/magic-akari--ncmc.4faead9/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..72ac1c4f8203f04945dae98d31e4c7dcf0a0f31c --- /dev/null +++ b/magic-akari--ncmc.4faead9/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/magic-akari--ncmc.4faead9" +description = "Synthetic ProgramGym cleanroom reconstruction task for magic-akari/ncmc" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "magic-akari__ncmc.4faead9" +repository = "magic-akari/ncmc" +commit = "4faead9aaa0a6e143210d468715185db347dc66a" +language = "rust" +difficulty = "easy" +difficulty_score = 0.8773713458697738 +test_branches = 4 +test_count = 832 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/magic-akari--ncmc.4faead9/tests/Dockerfile b/magic-akari--ncmc.4faead9/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_01.tar.gz b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..de5931e2dfc64deb5e10422cd3190133cb9c3b84 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd1999023c3a42b0910612e000d6e65147030b458c1f79ded73c940d28fa933c +size 14577231 diff --git a/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_02.tar.gz b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9118b1be1fd206f578f383c86553b0c1d0870377 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e0b79f5c61d6083b0a6e014f43522c4b2643fcba706aaf528d93767f8443963 +size 6229661 diff --git a/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_03.tar.gz b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3bdb0a6b73e28f4fa5cc84c9c28dc7d0a1ebd2b4 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e284dbbad2482cb6309b4ce02aa77abb2df7839debf519171ece9db719c2569c +size 19147 diff --git a/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_04.tar.gz b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8c6a4d6ba35c09b3b486176fe86056a902a4b406 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49d300006146f8545ccbfd7f94987a8bf45bc8b983af121cf096091034d73ec0 +size 11066278 diff --git a/magic-akari--ncmc.4faead9/tests/download.sh b/magic-akari--ncmc.4faead9/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a2a8662a448aff549da22be44a1d17a9fcbce3d --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/download.sh @@ -0,0 +1,1803 @@ +#!/usr/bin/env bash +# ProgramGym download.sh for magic-akari/ncmc (Rust workspace). +# Stage 1 (networked): regenerate a self-contained workspace manifest tree in a +# temp dir using inline heredocs, embed the exact locked resolution, and run one +# explicit `cargo fetch --manifest-path` against that generated root manifest. +# This fills the shared cargo registry cache with every crate version the offline +# Stage 2 build needs. It performs NO build, link, test, or packaging step. +# Source-safe: exported env vars persist in the current shell; no `exit` in normal flow. + +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + SOURCED=1 +else + SOURCED=0 +fi + +warn_fail() { + echo "download.sh: error: $*" >&2 + if [ "$SOURCED" = "1" ]; then + return 1 + else + exit 1 + fi +} + +GEN="${TMPDIR:-/tmp}/ncmc_depgen" +rm -rf "$GEN" +mkdir -p "$GEN/crates/ncm_core/src" +mkdir -p "$GEN/crates/ncm_meta/src" +mkdir -p "$GEN/crates/ncmc/src" +mkdir -p "$GEN/crates/ncmc_wasm/src" + +cat > "$GEN/Cargo.toml" <<'PBTOML' +[workspace] +members = ["crates/*"] +resolver = "2" + + [workspace.package] + authors = ["magic-akari "] + edition = "2021" + homepage = "https://github.com/magic-akari/ncmc" + license = "MIT" + readme = "README.md" + repository = "https://github.com/magic-akari/ncmc" + version = "0.2.11" + + [workspace.dependencies] + ncm_core = { version = "0.2.11", path = "crates/ncm_core" } + ncm_meta = { version = "0.2.11", path = "crates/ncm_meta" } + + aes = "0.8.4" + anyhow = "1.0.89" + base64 = "0.22.1" + bpaf = "0.9" + ecb = "0.1.2" + id3 = "1.14.0" + js-sys = "0.3.70" + metaflac = "0.2.7" + miniserde = "0.1" + serde-wasm-bindgen = "0.6" + testing = "0.42.0" + wasm-bindgen = "0.2.93" + +[profile.release] +lto = true +panic = "abort" +strip = "debuginfo" +PBTOML + +cat > "$GEN/crates/ncm_core/Cargo.toml" <<'PBTOML' +[package] +name = "ncm_core" + +description = "core decoder for ncmc" +keywords = ["ncm", "ncmc", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + +[dependencies] +aes = { workspace = true } +anyhow = { workspace = true } +base64 = { workspace = true } +ecb = { workspace = true } +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncm_core/src/lib.rs" + +cat > "$GEN/crates/ncm_meta/Cargo.toml" <<'PBTOML' +[package] +name = "ncm_meta" + +description = "music meta utils for ncmc" +keywords = ["ncm", "ncmc", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + +[dependencies] +anyhow = { workspace = true } +id3 = { workspace = true } +metaflac = { workspace = true } +miniserde = { workspace = true } +ncm_core = { workspace = true } + +[dev-dependencies] +testing = { workspace = true } +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncm_meta/src/lib.rs" + +cat > "$GEN/crates/ncmc/Cargo.toml" <<'PBTOML' +[package] +name = "ncmc" + +description = "convert encrypted ncm file to original music file." +keywords = ["ncm", "ncmc", "cli", "converter", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + + +[dependencies] +anyhow = { workspace = true } +bpaf = { workspace = true, features = ["derive"] } +ncm_core = { workspace = true } +ncm_meta = { workspace = true } + +[dev-dependencies] +testing = { workspace = true } +PBTOML +printf 'fn main() {}\n' > "$GEN/crates/ncmc/src/main.rs" + +cat > "$GEN/crates/ncmc_wasm/Cargo.toml" <<'PBTOML' +[package] +name = "ncmc_wasm" + +description = "convert encrypted ncm file to original music file." +keywords = ["ncm", "ncmc", "converter", "ncmdump"] + +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +readme = { workspace = true } +repository = { workspace = true } +version = { workspace = true } + + +[dependencies] +anyhow = { workspace = true } +js-sys = { workspace = true } +ncm_core = { workspace = true } +ncm_meta = { workspace = true } +serde-wasm-bindgen = { workspace = true } +wasm-bindgen = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] +PBTOML +printf 'pub fn _stub() {}\n' > "$GEN/crates/ncmc_wasm/src/lib.rs" + +cat > "$GEN/Cargo.lock" <<'PBLOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "ast_node" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d23a6d1d5f18bdbc06d9aa908880e5f49205156ba804751af731c51f5cf81a" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.91", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "better_scoped_tls" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297b153aa5e573b5863108a6ddc9d5c968bd0b20e75cc614ee9821d2f45679c7" +dependencies = [ + "scoped-tls", +] + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bpaf" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50fd5174866dc2fa2ddc96e8fb800852d37f064f32a45c7b7c2f8fa2c64c77fa" +dependencies = [ + "bpaf_derive", +] + +[[package]] +name = "bpaf_derive" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf95d9c7e6aba67f8fc07761091e93254677f4db9e27197adecebc7039a58722" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cpufeatures" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "ecb" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a8bfa975b1aec2145850fcaa1c6fe269a16578c44705a532ae3edc92b8881c7" +dependencies = [ + "cipher", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "from_variant" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d8947525c49c73130b5a7187b55b027b6b78fe60268d9f4c283ed690698cb1" +dependencies = [ + "proc-macro2", + "swc_macros_common", + "syn 2.0.91", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hstr" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" +dependencies = [ + "hashbrown", + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "triomphe", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "id3" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1df50e6c625115513974d5efc34c4bc55524145e14cb2297e909ab5ece0d49" +dependencies = [ + "bitflags", + "byteorder", + "flate2", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "metaflac" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f083edae4a21f5acb1fda8220d1c14fa31f725bfd4e21005a14c2d8944db9b" +dependencies = [ + "byteorder", + "hex", +] + +[[package]] +name = "miette" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" +dependencies = [ + "cfg-if", + "miette-derive", + "owo-colors", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "mini-internal" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07b7f1340a7f0d2f89755aac4096f1c55352bfcb95cb8f351d6fcefa18df474f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "miniserde" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625208b7bc90255fe6d99338041880bf48a3049166f46fbefbd4e9b0478c0b66" +dependencies = [ + "itoa", + "mini-internal", + "ryu", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +dependencies = [ + "adler2", +] + +[[package]] +name = "ncm_core" +version = "0.2.11" +dependencies = [ + "aes", + "anyhow", + "base64", + "ecb", +] + +[[package]] +name = "ncm_meta" +version = "0.2.11" +dependencies = [ + "anyhow", + "id3", + "metaflac", + "miniserde", + "ncm_core", + "testing", +] + +[[package]] +name = "ncmc" +version = "0.2.11" +dependencies = [ + "anyhow", + "bpaf", + "ncm_core", + "ncm_meta", + "testing", +] + +[[package]] +name = "ncmc_wasm" +version = "0.2.11" +dependencies = [ + "anyhow", + "js-sys", + "ncm_core", + "ncm_meta", + "serde-wasm-bindgen", + "wasm-bindgen", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.216" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "serde_json" +version = "1.0.134" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "swc_allocator" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76aa0eb65c0f39f9b6d82a7e5192c30f7ac9a78f084a21f270de1d8c600ca388" +dependencies = [ + "bumpalo", + "hashbrown", + "ptr_meta", + "rustc-hash", + "triomphe", +] + +[[package]] +name = "swc_atoms" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b25ff0f3fd48ab1a95d86fd0505fdd1ac904f84d0350dc8222bbc824e9d4fdf6" +dependencies = [ + "hstr", + "once_cell", + "rustc-hash", + "serde", +] + +[[package]] +name = "swc_common" +version = "0.40.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca32839a37f3b12213b18623b1bd58d37641cab750c50c3c287876cb98b12ab4" +dependencies = [ + "ast_node", + "better_scoped_tls", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "parking_lot", + "rustc-hash", + "serde", + "siphasher", + "swc_allocator", + "swc_atoms", + "swc_eq_ignore_macros", + "swc_visit", + "termcolor", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "swc_eq_ignore_macros" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63db0adcff29d220c3d151c5b25c0eabe7e32dd936212b84cdaa1392e3130497" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "swc_error_reporters" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f9286183c9be40aafcbbe8c397403fb32af812a3dffe93eee9067aee4fbedb" +dependencies = [ + "anyhow", + "miette", + "once_cell", + "parking_lot", + "swc_common", +] + +[[package]] +name = "swc_macros_common" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e18fbfe83811ffae2bb23727e45829a0d19c6870bced7c0f545cc99ad248dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "swc_visit" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ceb044142ba2719ef9eb3b6b454fce61ab849eb696c34d190f04651955c613d" +dependencies = [ + "either", + "new_debug_unreachable", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "testing" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9217860da21fabe9c65981ba42f6dad2bd8f463b670448afe79aa9d50f0bc137" +dependencies = [ + "ansi_term", + "cargo_metadata", + "difference", + "once_cell", + "pretty_assertions", + "regex", + "serde", + "serde_json", + "swc_common", + "swc_error_reporters", + "testing_macros", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "testing_macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39660370116afe46d5ff8bcb01b7afe2140dda3137ef5cb1914681e37a4ee06" +dependencies = [ + "anyhow", + "glob", + "once_cell", + "proc-macro2", + "quote", + "regex", + "relative-path", + "syn 2.0.91", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "triomphe" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" +dependencies = [ + "serde", + "stable_deref_trait", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.91", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] +PBLOCK + +# Populate the shared registry cache with the exact locked resolution, using an +# explicit generated manifest path (never the repo root or /source_ro). +if ! cargo fetch --locked --manifest-path "$GEN/Cargo.toml"; then + # NOTE: the message wording is chosen not to echo the command token sequence + # back into the diagnostic, keeping the generated script unambiguous. + warn_fail "dependency prefetch (locked, generated manifest) failed; registry cache not populated" +fi + +# Nothing is built, linked, tested, packaged, or installed by this stage. +echo "download.sh: dependency prefetch complete." diff --git a/magic-akari--ncmc.4faead9/tests/executable b/magic-akari--ncmc.4faead9/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..b2a5e5b8c74825be476f1c3adc7f4b75d899e888 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdd50802f417a1a6637e9109d83575660e11ce029465cf15f50c79e222d74516 +size 994488 diff --git a/magic-akari--ncmc.4faead9/tests/harbor_prepare_download_env.sh b/magic-akari--ncmc.4faead9/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/magic-akari--ncmc.4faead9/tests/programgym_evaluator.py b/magic-akari--ncmc.4faead9/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/magic-akari--ncmc.4faead9/tests/programgym_task.json b/magic-akari--ncmc.4faead9/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..df49f9f06bc8b483d2eb51a954989f96e50fc5b2 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/programgym_task.json @@ -0,0 +1,2614 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_version_precedence_in_auto_mode", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arg_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_help_version.TestHelp.test_help_lists_help_and_version_flags", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_help_version.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_help_version.TestHelp.test_help_lists_input_positional", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_help_version.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_gain_is_float_or_absent", + "reasons": [ + { + "detail": "empty executable run failed as expected with returncode=1", + "id": "dummy_pass", + "message": "test passed against the empty executable", + "repair_hint": "Assert concrete black-box executable behavior so an empty executable cannot satisfy the test.", + "severity": "error", + "stage": "dummy_execution" + }, + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_metadata_schema.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_metadata_schema.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_metadata_schema.TestMetadataSchema.test_metadata_keys_are_stable_union", + "reasons": [ + { + "detail": "empty executable run failed as expected with returncode=1", + "id": "dummy_pass", + "message": "test passed against the empty executable", + "repair_hint": "Assert concrete black-box executable behavior so an empty executable cannot satisfy the test.", + "severity": "error", + "stage": "dummy_execution" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_metadata_schema.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_state_transitions.TestPartialFailureAuto.test_valid_then_missing_keeps_first_output", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_state_transitions.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_absent_fields_dump.TestAbsolutePathInput.test_auto_absolute_path_echo_and_output", + "eval.tests.test_absent_fields_dump.TestAbsolutePathInput.test_dump_absolute_path_sidecars_next_to_input", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_comment_present_exact", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_full_sidecar_set_without_jpeg", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_json_present_and_valid", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_key_and_audio_exact", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_no_image_sidecar_any_ext", + "eval.tests.test_absent_fields_dump.TestCommentNoImageDump.test_stderr_has_full_meta_json", + "eval.tests.test_absent_fields_dump.TestFilenamesWithSpacesAndUnicode.test_auto_name_with_spaces_and_unicode[\\u97f3\\u697d song test.ncm]", + "eval.tests.test_absent_fields_dump.TestFilenamesWithSpacesAndUnicode.test_auto_name_with_spaces_and_unicode[my song 2.ncm]", + "eval.tests.test_absent_fields_dump.TestFilenamesWithSpacesAndUnicode.test_dump_name_with_unicode_preserves_base", + "eval.tests.test_absent_fields_dump.TestMinimalAutoMode.test_auto_comment_no_image_mp3_exact", + "eval.tests.test_absent_fields_dump.TestMinimalAutoMode.test_auto_no_image_does_not_dump_sidecars", + "eval.tests.test_absent_fields_dump.TestMinimalAutoMode.test_auto_no_meta_reports_literal", + "eval.tests.test_absent_fields_dump.TestMinimalMixedBatch.test_dump_mixed_batch_sidecars", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_comment_sidecar", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_image_sidecar", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_meta_audio_bytes_exact", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_meta_key_bytes_exact", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_meta_no_json_sidecar", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_meta_stderr_is_literal", + "eval.tests.test_absent_fields_dump.TestNoMetaNoCommentNoImageDump.test_no_meta_writes_only_key_and_audio", + "eval.tests.test_auto_mode.TestAutoAudioFormat.test_auto_flac_magic", + "eval.tests.test_auto_mode.TestAutoAudioFormat.test_auto_mp3_id3v24_tag", + "eval.tests.test_auto_mode.TestAutoAudioFormat.test_auto_mp3_magic", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1356233945.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1431343706.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1434241304.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1463406864.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1481911318.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[1832399351.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[31654862.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[509330088.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[583277.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_audio_decoded_not_equal_source[807325.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_flac_output_nonempty_magic[1431343706.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_flac_output_nonempty_magic[31654862.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_flac_output_nonempty_magic[509330088.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_flac_output_nonempty_magic[583277.ncm]", + "eval.tests.test_auto_mode.TestAutoAudioNonempty.test_flac_output_nonempty_magic[807325.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1356233945.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1431343706.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1434241304.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1463406864.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1481911318.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[1832399351.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[31654862.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[509330088.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[583277.ncm]", + "eval.tests.test_auto_mode.TestAutoFileLayout.test_auto_writes_only_audio[807325.ncm]", + "eval.tests.test_auto_mode.TestAutoFlacStructural.test_auto_flac_is_valid_container[1431343706.ncm]", + "eval.tests.test_auto_mode.TestAutoFlacStructural.test_auto_flac_is_valid_container[31654862.ncm]", + "eval.tests.test_auto_mode.TestAutoFlacStructural.test_auto_flac_is_valid_container[509330088.ncm]", + "eval.tests.test_auto_mode.TestAutoFlacStructural.test_auto_flac_is_valid_container[583277.ncm]", + "eval.tests.test_auto_mode.TestAutoFlacStructural.test_auto_flac_is_valid_container[807325.ncm]", + "eval.tests.test_auto_mode.TestAutoGoldenAudio.test_auto_mp3_writes_exact_audio[1356233945.ncm]", + "eval.tests.test_auto_mode.TestAutoGoldenAudio.test_auto_mp3_writes_exact_audio[1434241304.ncm]", + "eval.tests.test_auto_mode.TestAutoGoldenAudio.test_auto_mp3_writes_exact_audio[1463406864.ncm]", + "eval.tests.test_auto_mode.TestAutoGoldenAudio.test_auto_mp3_writes_exact_audio[1481911318.ncm]", + "eval.tests.test_auto_mode.TestAutoGoldenAudio.test_auto_mp3_writes_exact_audio[1832399351.ncm]", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_meta_emitted_to_stderr[1356233945.ncm-Eye Catch]", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_meta_emitted_to_stderr[1431343706.ncm-\\u30a2\\u30a4\\u30ad\\u30e3\\u30c3\\u30c1]", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_meta_emitted_to_stderr[31654862.ncm-\\u52c7\\u8005\\u30a2\\u30d7\\u30ea\\u30fb\\u30e1\\u30fc\\u30eb\\u7740\\u4fe1]", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_meta_json_has_artist", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_meta_json_has_music_id", + "eval.tests.test_auto_mode.TestAutoStderrMeta.test_stderr_meta_matches_golden_dump_json", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1356233945.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1431343706.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1434241304.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1463406864.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1481911318.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[1832399351.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[31654862.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[509330088.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[583277.ncm]", + "eval.tests.test_auto_mode.TestAutoStdoutPath.test_stdout_reports_destination[807325.ncm]", + "eval.tests.test_cli_arg_edge_cases.TestDoubleDashSeparator.test_separator_forwards_positional_to_auto", + "eval.tests.test_cli_arg_edge_cases.TestDoubleDashSeparator.test_separator_forwards_positional_to_dump", + "eval.tests.test_cli_arg_edge_cases.TestDoubleDashSeparator.test_separator_marks_literal_dump_as_input_in_dump_mode", + "eval.tests.test_cli_arg_edge_cases.TestDoubleDashSeparator.test_separator_turns_mode_flag_into_filename", + "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_version_precedence_in_auto_mode", + "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_wins_over_version[h-v]", + "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_wins_over_version[short-h-v]", + "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_wins_over_version[short-v-h]", + "eval.tests.test_cli_arg_edge_cases.TestHelpVersionPrecedence.test_help_wins_over_version[v-h]", + "eval.tests.test_cli_arg_edge_cases.TestInterspersedFlags.test_auto_flag_after_positional", + "eval.tests.test_cli_arg_edge_cases.TestInterspersedFlags.test_conflict_detected_even_after_positional", + "eval.tests.test_cli_arg_edge_cases.TestInterspersedFlags.test_dump_flag_after_positional", + "eval.tests.test_cli_arg_edge_cases.TestInterspersedFlags.test_flag_interspersed_between_two_positionals", + "eval.tests.test_cli_arg_edge_cases.TestRepeatedFlags.test_auto_flag_repeated_rejected[empty]", + "eval.tests.test_cli_arg_edge_cases.TestRepeatedFlags.test_auto_flag_repeated_rejected[with-positional]", + "eval.tests.test_cli_arg_edge_cases.TestRepeatedFlags.test_dump_flag_repeated_rejected[empty]", + "eval.tests.test_cli_arg_edge_cases.TestRepeatedFlags.test_dump_flag_repeated_rejected[with-positional]", + "eval.tests.test_cli_arg_edge_cases.TestShortFlagDiagnostics.test_unknown_short_flag_diagnostic_differs_from_long", + "eval.tests.test_cli_arg_edge_cases.TestShortFlagDiagnostics.test_unknown_short_flag_rejected[q]", + "eval.tests.test_cli_arg_edge_cases.TestShortFlagDiagnostics.test_unknown_short_flag_rejected[x]", + "eval.tests.test_cli_arg_edge_cases.TestShortFlagDiagnostics.test_unknown_short_flag_rejected[z]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpAudioGolden.test_dump_audio_exact[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpCommentGolden.test_comment_exact[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpFileSet.test_dump_sidecar_set[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_exact[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpImageGolden.test_image_file_present_for_every_fixture", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_file_exact[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpKeyGolden.test_key_starts_after_magic", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_exact[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1356233945.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1431343706.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1434241304.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1463406864.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1481911318.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[1832399351.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[31654862.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[509330088.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[583277.ncm]", + "eval.tests.test_dump_mode.TestDumpMetaJSONGolden.test_json_is_valid_metadata[807325.ncm]", + "eval.tests.test_dump_mode.TestDumpStdoutStderr.test_stderr_meta_json", + "eval.tests.test_dump_mode.TestDumpStdoutStderr.test_stdout_reports_input", + "eval.tests.test_help_version.TestEmptyInvocation.test_dump_mode_with_no_input_exits_zero", + "eval.tests.test_help_version.TestEmptyInvocation.test_explicit_auto_mode_with_no_input_exits_zero", + "eval.tests.test_help_version.TestEmptyInvocation.test_no_args_exits_zero_with_empty_output", + "eval.tests.test_help_version.TestEmptyInvocation.test_no_args_writes_no_program_files", + "eval.tests.test_help_version.TestExplicitModeFlags.test_auto_and_dump_are_mutually_exclusive", + "eval.tests.test_help_version.TestExplicitModeFlags.test_bogus_flag_rejected", + "eval.tests.test_help_version.TestExplicitModeFlags.test_bogus_flag_writes_no_program_files", + "eval.tests.test_help_version.TestExplicitModeFlags.test_explicit_auto_flag_accepted", + "eval.tests.test_help_version.TestHelp.test_help_describes_convert_mode", + "eval.tests.test_help_version.TestHelp.test_help_describes_dump_mode", + "eval.tests.test_help_version.TestHelp.test_help_inline_usage_text", + "eval.tests.test_help_version.TestHelp.test_help_lists_help_and_version_flags", + "eval.tests.test_help_version.TestHelp.test_help_lists_input_positional", + "eval.tests.test_help_version.TestHelp.test_help_long_matches_golden_usage", + "eval.tests.test_help_version.TestHelp.test_help_prints_no_stderr", + "eval.tests.test_help_version.TestHelp.test_short_help_matches_golden_usage", + "eval.tests.test_help_version.TestSingleDashPositional.test_single_dash_token_treated_as_filename", + "eval.tests.test_help_version.TestVersion.test_version_long_matches_package", + "eval.tests.test_help_version.TestVersion.test_version_pattern", + "eval.tests.test_help_version.TestVersion.test_version_prints_no_stderr", + "eval.tests.test_help_version.TestVersion.test_version_short_matches_package", + "eval.tests.test_input_errors.TestBadHeader.test_partial_header_too_short", + "eval.tests.test_input_errors.TestBadHeader.test_uppercase_only_magic_still_rejected", + "eval.tests.test_input_errors.TestBadHeader.test_wrong_header_dump_mode", + "eval.tests.test_input_errors.TestBadHeader.test_wrong_magic_header", + "eval.tests.test_input_errors.TestDirectoryInput.test_directory_as_input_auto", + "eval.tests.test_input_errors.TestDirectoryInput.test_directory_as_input_dump", + "eval.tests.test_input_errors.TestDirectoryInput.test_directory_creates_no_sidecar", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_auto_vs_dump[auto]", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_auto_vs_dump[dump]", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_context_uses_longest_path", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_dump_reports_basename_input", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_no_stdout", + "eval.tests.test_input_errors.TestMissingInputFile.test_missing_file_writes_no_program_output", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[auto-empty]", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[auto-header-nul]", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[auto-header-only]", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[dump-empty]", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[dump-header-nul]", + "eval.tests.test_input_errors.TestTruncatedAndEmpty.test_truncated_input_variants[dump-header-only]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1356233945]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1431343706]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1434241304]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1463406864]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1481911318]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[1832399351]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[31654862]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[509330088]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[583277]", + "eval.tests.test_metadata_schema.TestAutoMetadataParseable.test_auto_meta_is_valid_json_with_music_fields[807325]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1356233945]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1431343706]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1434241304]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1463406864]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1481911318]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[1832399351]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[31654862]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[509330088]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[583277]", + "eval.tests.test_metadata_schema.TestAutoStderrEqualsDumpJsonGolden.test_auto_stderr_meta_equals_golden[807325]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_alias_exact_values[1356233945-expected_alias4]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_alias_exact_values[1463406864-expected_alias2]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_alias_exact_values[1832399351-expected_alias1]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_alias_exact_values[31654862-expected_alias0]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_alias_exact_values[583277-expected_alias3]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_gain_is_float_or_absent", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_large_ids_serialize_as_string[1463406864-str-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_large_ids_serialize_as_string[509330088-str-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[1356233945-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[1431343706-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[1434241304-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[31654862-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[583277-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_small_ids_serialize_as_integer[807325-int-id]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_transnames_nonempty_exact[31654862-expected0]", + "eval.tests.test_metadata_schema.TestMetadataDtypeSwitches.test_transnames_nonempty_exact[807325-expected1]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1356233945]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1431343706]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1434241304]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1463406864]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1481911318]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[1832399351]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[31654862]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[509330088]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[583277]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_dump_json_has_full_schema[807325]", + "eval.tests.test_metadata_schema.TestMetadataSchema.test_metadata_keys_are_stable_union", + "eval.tests.test_state_transitions.TestArbitraryExtensionInput.test_auto_arbitrary_ext_produces_mp3", + "eval.tests.test_state_transitions.TestArbitraryExtensionInput.test_dump_arbitrary_ext_sidecars", + "eval.tests.test_state_transitions.TestArbitraryExtensionInput.test_dump_no_extension_produces_no_stray", + "eval.tests.test_state_transitions.TestAutoThenDump.test_convert_then_dump_sidecars", + "eval.tests.test_state_transitions.TestDuplicateInputPaths.test_auto_duplicate_path_processed_twice", + "eval.tests.test_state_transitions.TestDuplicateInputPaths.test_dump_duplicate_path_writes_sidecars_once_each", + "eval.tests.test_state_transitions.TestDuplicateInputPaths.test_duplicate_identical_input_deterministic", + "eval.tests.test_state_transitions.TestMultiInputAuto.test_auto_multiple_inputs[flac-pair]", + "eval.tests.test_state_transitions.TestMultiInputAuto.test_auto_multiple_inputs[mp3-then-flac]", + "eval.tests.test_state_transitions.TestMultiInputAuto.test_auto_multiple_inputs[three-mixes]", + "eval.tests.test_state_transitions.TestMultiInputDump.test_dump_multiple_inputs", + "eval.tests.test_state_transitions.TestOutputLocation.test_auto_output_relative_to_input_dir", + "eval.tests.test_state_transitions.TestPartialFailureAuto.test_valid_then_bad_header_keeps_first_output", + "eval.tests.test_state_transitions.TestPartialFailureAuto.test_valid_then_missing_keeps_first_output", + "eval.tests.test_state_transitions.TestPartialFailureDump.test_dump_partial_keeps_sidecars", + "eval.tests.test_state_transitions.TestReRunOverwrites.test_auto_rerun_is_idempotent", + "eval.tests.test_state_transitions.TestReRunOverwrites.test_dump_rerun_overwrites_stale_audio", + "eval.tests.test_write_errors.TestAutoOutputIsDirectory.test_auto_audio_dir_fails[1356233945]", + "eval.tests.test_write_errors.TestAutoOutputIsDirectory.test_auto_audio_dir_fails[1434241304]", + "eval.tests.test_write_errors.TestAutoOutputIsDirectory.test_auto_audio_dir_fails[31654862]", + "eval.tests.test_write_errors.TestAutoOutputIsDirectory.test_auto_audio_dir_fails[583277]", + "eval.tests.test_write_errors.TestAutoOutputIsDirectory.test_auto_audio_dir_keeps_input_untouched", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_file_set", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_partial_sidecars[1356233945]", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_partial_sidecars[1434241304]", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_partial_sidecars[31654862]", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_partial_sidecars[583277]", + "eval.tests.test_write_errors.TestDumpAudioOutputIsDirectory.test_dump_audio_dir_sidecar_bytes_exact" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_audio_type_detection.test_known_signature_wins_over_m4a_suffix[ID3-\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00]", + "reasons": [ + { + "detail": "assert 1 == 0", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_custom_metadata_json_echoed", + "reasons": [ + { + "detail": "assert '{\"musicId\":9...mat\":\"mp3\"}\\n' == '{\"musicId\":9...ormat\":\"mp3\"}' Skipping 125 identical leading characters in diff, use -v to show - mat\":\"mp3\"} + mat\":\"mp3\"} ? +", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1356233945-mp3]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"m...sNames\":[]}\\n' == '{\"format\":\"m...ansNames\":[]}' Skipping 371 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1431343706-flac]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"f...sNames\":[]}\\n' == '{\"format\":\"f...ansNames\":[]}' Skipping 350 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1434241304-mp3]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"m...sNames\":[]}\\n' == '{\"format\":\"m...ansNames\":[]}' Skipping 365 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1463406864-mp3]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"musicId\":\"...\":1277957}}\\n' == '{\"musicId\":\"...ag\":1277957}}' Skipping 462 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1481911318-mp3]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"musicId\":1...mat\":\"mp3\"}\\n' == '{\"musicId\":1...ormat\":\"mp3\"}' Skipping 371 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[1832399351-mp3]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"m...sNames\":[]}\\n' == '{\"format\":\"m...ansNames\":[]}' Skipping 377 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[31654862-flac]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"f...app\u00b7\u6765\u8baf\u606f\u4e86\"]}\\n' == '{\"format\":\"f...\u52c7\u8005app\u00b7\u6765\u8baf\u606f\u4e86\"]}' Skipping 422 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[509330088-flac]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"musicId\":\"...\":1278212}}\\n' == '{\"musicId\":\"...ag\":1278212}}' Skipping 447 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[583277-flac]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"format\":\"f...sNames\":[]}\\n' == '{\"format\":\"f...ansNames\":[]}' Skipping 352 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_metadata_echoed_on_stderr[807325-flac]", + "reasons": [ + { + "detail": "AssertionError: recovered metadata should equal the committed golden json assert '{\"musicId\":8...at\":\"flac\"}\\n' == '{\"musicId\":8...rmat\":\"flac\"}' Skipping 369 identical leading characters in diff, use", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_golden_output_has_valid_audio_signature[1356233945]", + "reasons": [ + { + "detail": "AssertionError: assert b'ID3\\x04' in (b'ID3', b'fLaC')", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_one_bad_input_aborts_remaining", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_auto.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_auto.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auto.test_auto_preserves_extension_from_audio_type_only", + "reasons": [ + { + "detail": "assert -6 == 0", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli.test_auto_subcommand_help", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_combined_auto_flag_and_input_ok", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_cli.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_directory_as_input_is_rejected", + "reasons": [ + { + "detail": "AssertionError: assert 'input' in 'Error: Is a directory (os error 21)\\n'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_dump_subcommand_help", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_missing_positional_metavar_shown_in_help", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_cli.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_nonexistent_input_prints_error_to_stderr", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_decoder_edges_deep.test_auto_multiple_then_bad_prefix_aborts_after_ok", + "reasons": [ + { + "detail": "AssertionError: assert False + where False = ('/tmp/pytest-of-root/pytest-2/popen-gw13/test_auto_multiple_then_bad_pr0/one.mp3') + where 100000 + where 74073 = ('/tmp/pytest-of-root/pytest-2/popen-gw4/test_dump_golden_audio_written0/1463406864.mp3') + where .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-256-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-short-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-single-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_different_keys_produce_different_plaintext", + "reasons": [ + { + "detail": "AssertionError: assert b'OggS\\x0b0Uz\\x9f\\xc4\\xe9\\x0e3X}\\xa2\\xc7\\xec\\x116[\\x80\\xa5\\xca\\xef\\x149^\\x83\\xa8\\xcd\\xf2\\x17.returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-256-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-short-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-single-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_rc4_decryption.test_zero_length_rc4_key_still_decodes", + "reasons": [ + { + "detail": "IndexError: index out of range", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[flac]", + "reasons": [ + { + "detail": "AssertionError: assert 't.flac' == 't.ncm.flac' - t.ncm.flac ? ---- + t.flac", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[m4a_ftyp]", + "reasons": [ + { + "detail": "AssertionError: assert 't.m4a' == 't.ncm.m4a' - t.ncm.m4a + t.m4a", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[mp3_id3_tag]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[mp3_syncword]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[ogg]", + "reasons": [ + { + "detail": "AssertionError: assert 't.ogg' == 't.ncm.ogg' - t.ncm.ogg + t.ogg", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[unknown]", + "reasons": [ + { + "detail": "AssertionError: assert 't.audio' == 't.ncm.audio' - t.ncm.audio ? ---- + t.audio", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[mp3_id3_tag]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[mp3_syncword]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_empty_beyond_header_audio_body_preserved", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_m4a_detection_requires_exact_ftyp_marker", + "reasons": [ + { + "detail": "AssertionError: assert 'm.audio' == 'm.ncm.audio' - m.ncm.audio ? ---- + m.audio", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_audio_type_detection.test_mp3_id3_and_syncword_share_mp3_extension", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_auto_encode_image_mime.test_auto_invalid_metadata_json_errors_before_picture", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_auto_encode_image_mime.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auto_encode_image_mime.test_auto_mp3_embeds_mime_and_picture_in_apic_frame", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_auto_encode_image_mime.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_auto_encode_image_mime.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_directory_input_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_garbage_key_frame_errors", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_help_long_flag_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_help_output_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_missing_input_mentions_os_error", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_partial_header_input_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_short_input_no_deadlock", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_error_branches.test_truncated_zero_byte_input_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_error_branches.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dump_extraction.test_auto_mode_prints_output_path_on_stdout", + "reasons": [ + { + "detail": "AssertionError: assert 'auto.ncm' == 'auto.ncm.flac' - auto.ncm.flac ? ----- + auto.ncm", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_dump_extraction.test_auto_mode_with_comment_prints_meta_on_stderr", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_dump_extraction.test_dump_writes_decrypted_comment_file", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-full-period-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-mid-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-single-letter-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-two-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-two-fifty-five-byte-key]", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_distinct_keys_yield_distinct_keystreams_and_recover_plaintext", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_rc4_crypto_properties.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_rc4_crypto_properties.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rc4_crypto_properties.test_zero_byte_payload_audio_header_only", + "reasons": [ + { + "detail": "assert 1 == 0 + where 1 = .returncode", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_audio_format_boundaries.test_detection_uses_decrypted_not_stored_header", + "eval.tests.test_audio_format_boundaries.test_flac_plaintext_with_7bit_payload_body", + "eval.tests.test_audio_format_boundaries.test_lowercase_flac_header_is_unknown", + "eval.tests.test_audio_format_boundaries.test_m4a_ftyp_requires_exact_12_byte_window", + "eval.tests.test_audio_format_boundaries.test_m4a_ftyp_wrong_last_byte_is_unknown", + "eval.tests.test_audio_format_boundaries.test_mp3_syncword_single_marker_bits", + "eval.tests.test_audio_format_boundaries.test_ogg_header_payload_preserved_exactly", + "eval.tests.test_audio_format_boundaries.test_zero_header_is_unknown", + "eval.tests.test_audio_rc4_decryption.test_audio_after_256_byte_period_is_still_exact", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-short-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-1-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-12-header-only-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-12-header-only-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-12-header-only-short-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-12-header-only-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-256-exact-period-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-256-exact-period-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-256-exact-period-short-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-256-exact-period-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-257-wrap-one-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-257-wrap-one-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-257-wrap-one-short-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-257-wrap-one-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-600-wrap-many-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-600-wrap-many-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-600-wrap-many-short-key]", + "eval.tests.test_audio_rc4_decryption.test_auto_output_is_exact_plaintext[len-600-wrap-many-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_different_keys_produce_different_plaintext", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-short-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-1-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-12-header-only-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-12-header-only-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-12-header-only-short-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-12-header-only-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-256-exact-period-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-256-exact-period-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-256-exact-period-short-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-256-exact-period-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-257-wrap-one-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-257-wrap-one-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-257-wrap-one-short-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-257-wrap-one-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-600-wrap-many-16-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-600-wrap-many-256-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-600-wrap-many-short-key]", + "eval.tests.test_audio_rc4_decryption.test_dump_output_is_exact_plaintext[len-600-wrap-many-single-byte-key]", + "eval.tests.test_audio_rc4_decryption.test_rc4_decryption_is_deterministic_across_runs", + "eval.tests.test_audio_rc4_decryption.test_zero_length_rc4_key_still_decodes", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[flac]", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[m4a_ftyp]", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[mp3_id3_tag]", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[mp3_syncword]", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[ogg]", + "eval.tests.test_audio_type_detection.test_audio_type_detection_extension[unknown]", + "eval.tests.test_audio_type_detection.test_auto_mode_output_extension", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[flac]", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[m4a_ftyp]", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[mp3_id3_tag]", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[mp3_syncword]", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[ogg]", + "eval.tests.test_audio_type_detection.test_dump_mode_writes_audio_with_detected_extension[unknown]", + "eval.tests.test_audio_type_detection.test_empty_beyond_header_audio_body_preserved", + "eval.tests.test_audio_type_detection.test_m4a_detection_requires_exact_ftyp_marker", + "eval.tests.test_audio_type_detection.test_mp3_id3_and_syncword_share_mp3_extension", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-bmp]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-gif]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-jpeg]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-png]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-unknown]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_embeds_exact_mime_and_picture[flac-webp]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_mime_string_differs_by_image_type", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_music_name_and_album_embedded_in_ogg_comment", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-bmp]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-gif]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-jpeg]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-png]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-unknown]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_stdout_stderr_protocol[flac-webp]", + "eval.tests.test_auto_encode_image_mime.test_auto_flac_without_image_embeds_no_picture", + "eval.tests.test_auto_encode_image_mime.test_auto_invalid_metadata_json_errors_before_picture", + "eval.tests.test_auto_encode_image_mime.test_auto_mp3_embeds_mime_and_picture_in_apic_frame", + "eval.tests.test_auto_encode_image_mime.test_auto_mp3_output_matches_golden_bytes[mp3-gif]", + "eval.tests.test_auto_encode_image_mime.test_auto_mp3_output_matches_golden_bytes[mp3-jpeg]", + "eval.tests.test_auto_encode_image_mime.test_auto_mp3_output_matches_golden_bytes[mp3-png]", + "eval.tests.test_auto_encode_image_mime.test_auto_mp3_unknown_image_uses_wildcard_mime", + "eval.tests.test_cli_error_branches.test_auto_flag_without_input_is_noop", + "eval.tests.test_cli_error_branches.test_auto_non_ctenfdam_header_errors_empty_stdout", + "eval.tests.test_cli_error_branches.test_directory_input_errors", + "eval.tests.test_cli_error_branches.test_dump_flag_without_input_is_noop", + "eval.tests.test_cli_error_branches.test_garbage_key_frame_errors", + "eval.tests.test_cli_error_branches.test_help_long_flag_matches_golden", + "eval.tests.test_cli_error_branches.test_help_output_matches_golden", + "eval.tests.test_cli_error_branches.test_missing_input_file_errors[--auto]", + "eval.tests.test_cli_error_branches.test_missing_input_file_errors[--dump]", + "eval.tests.test_cli_error_branches.test_missing_input_mentions_os_error", + "eval.tests.test_cli_error_branches.test_no_args_is_successful_noop", + "eval.tests.test_cli_error_branches.test_non_ctenfdam_header_errors", + "eval.tests.test_cli_error_branches.test_partial_header_input_errors", + "eval.tests.test_cli_error_branches.test_short_input_no_deadlock", + "eval.tests.test_cli_error_branches.test_truncated_zero_byte_input_errors", + "eval.tests.test_cli_error_branches.test_version_output", + "eval.tests.test_dump_extraction.test_audio_output_written_even_when_image_present", + "eval.tests.test_dump_extraction.test_auto_mode_prints_output_path_on_stdout", + "eval.tests.test_dump_extraction.test_auto_mode_with_comment_prints_meta_on_stderr", + "eval.tests.test_dump_extraction.test_dump_full_chain_image_comment_audio_key", + "eval.tests.test_dump_extraction.test_dump_key_file_matches_recovered_key_for_key_sizes[one-byte-key]", + "eval.tests.test_dump_extraction.test_dump_key_file_matches_recovered_key_for_key_sizes[overflow-key]", + "eval.tests.test_dump_extraction.test_dump_key_file_matches_recovered_key_for_key_sizes[seventeen-byte-key]", + "eval.tests.test_dump_extraction.test_dump_key_file_matches_recovered_key_for_key_sizes[sixty-four-byte-key]", + "eval.tests.test_dump_extraction.test_dump_writes_decrypted_comment_file", + "eval.tests.test_dump_extraction.test_dump_writes_exact_rc4_key_bytes", + "eval.tests.test_dump_extraction.test_dump_writes_meta_to_audio_and_stdout_path", + "eval.tests.test_dump_extraction.test_dump_writes_metadata_json_file", + "eval.tests.test_dump_extraction.test_image_offset_skip_branch_still_decodes_audio", + "eval.tests.test_dump_extraction.test_no_comment_reports_meta_not_found", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[bmp-windows]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[gif-89a]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[jpeg-app0]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[jpeg-app1]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[jpeg-app8]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[jpeg-word-not-marker]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[png]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[unknown]", + "eval.tests.test_image_type_detection.test_dump_image_file_contents_exact[webp-riff]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[bmp-windows]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[gif-89a]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[jpeg-app0]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[jpeg-app1]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[jpeg-app8]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[jpeg-word-not-marker]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[png]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[unknown]", + "eval.tests.test_image_type_detection.test_dump_writes_image_with_detected_extension[webp-riff]", + "eval.tests.test_image_type_detection.test_gif_suffix_8a_detected", + "eval.tests.test_image_type_detection.test_no_image_field_writes_no_picture_file", + "eval.tests.test_image_type_detection.test_png_needs_exact_idat_marker_order", + "eval.tests.test_image_type_detection.test_two_containers_different_image_types_dump_distinct_files", + "eval.tests.test_image_type_detection.test_webp_requires_riff_webp_layout", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1000-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1000-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1000-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1000-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[1000-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[15-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[15-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[15-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[15-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[15-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[255-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[255-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[255-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[255-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[255-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[256-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[256-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[256-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[256-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[256-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[257-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[257-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[257-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[257-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[257-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[511-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[511-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[511-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[511-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[511-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[512-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[512-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[512-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[512-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[512-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[513-full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[513-mid-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[513-single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[513-two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_auto_recovers_plaintext_for_key_and_length[513-two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_distinct_keys_yield_distinct_keystreams_and_recover_plaintext", + "eval.tests.test_rc4_crypto_properties.test_dump_recovers_plaintext_for_flac_key[full-period-key]", + "eval.tests.test_rc4_crypto_properties.test_dump_recovers_plaintext_for_flac_key[mid-key]", + "eval.tests.test_rc4_crypto_properties.test_dump_recovers_plaintext_for_flac_key[single-letter-key]", + "eval.tests.test_rc4_crypto_properties.test_dump_recovers_plaintext_for_flac_key[two-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_dump_recovers_plaintext_for_flac_key[two-fifty-five-byte-key]", + "eval.tests.test_rc4_crypto_properties.test_keystream_period_wrap_is_recovered", + "eval.tests.test_rc4_crypto_properties.test_same_container_decodes_identically_across_working_dirs", + "eval.tests.test_rc4_crypto_properties.test_single_random_header_byte_audioless_unknown", + "eval.tests.test_rc4_crypto_properties.test_stored_stream_is_plaintext_xor_keystream", + "eval.tests.test_rc4_crypto_properties.test_zero_byte_payload_audio_header_only" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_auto_flac_tags.test_flac_keeps_encoded_audio_after_metadata", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_auto_flac_tags.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auto_mp3_tags.test_mp3_metadata_not_in_plaintext", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_auto_mp3_tags.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_errors.test_directory_input_is_rejected", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_errors.test_empty_file_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_explicit_auto_requires_no_prior_mode", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_help_is_on_stdout_not_stderr", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_help_mentions_default_auto_mode", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_help_short_flag_lists_both_modes", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_unknown_short_flag_is_rejected", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_version_flag_exits_zero_even_with_input", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_custom_flac_tool_description_present", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_custom_mp3_tool_frames_present", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_empty_artist_stderr_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_flac_strnum_produces_valid_flac", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_music_id_max_stderr_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_music_id_zero_stderr_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_custom_meta.test_string_music_id_stderr_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_custom_meta.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_encoder_complement.test_empty_meta_echoes_meta_not_found_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_encoder_complement.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_stdout_path.test_output_basename_duplicates_are_avoided_when_multiple_inputs", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_stdout_path.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_stdout_path.test_stdout_single_line_per_input", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_stdout_path.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_auto_basics.test_auto_creates_flac_output[1431343706]", + "eval.tests.test_auto_basics.test_auto_creates_flac_output[31654862]", + "eval.tests.test_auto_basics.test_auto_creates_flac_output[509330088]", + "eval.tests.test_auto_basics.test_auto_creates_flac_output[583277]", + "eval.tests.test_auto_basics.test_auto_creates_flac_output[807325]", + "eval.tests.test_auto_basics.test_auto_creates_mp3_output[1356233945]", + "eval.tests.test_auto_basics.test_auto_creates_mp3_output[1434241304]", + "eval.tests.test_auto_basics.test_auto_creates_mp3_output[1463406864]", + "eval.tests.test_auto_basics.test_auto_creates_mp3_output[1481911318]", + "eval.tests.test_auto_basics.test_auto_creates_mp3_output[1832399351]", + "eval.tests.test_auto_basics.test_auto_flac_audio_type_matches_meta[1431343706]", + "eval.tests.test_auto_basics.test_auto_flac_audio_type_matches_meta[31654862]", + "eval.tests.test_auto_basics.test_auto_flac_audio_type_matches_meta[509330088]", + "eval.tests.test_auto_basics.test_auto_flac_audio_type_matches_meta[583277]", + "eval.tests.test_auto_basics.test_auto_flac_audio_type_matches_meta[807325]", + "eval.tests.test_auto_basics.test_auto_mp3_audio_type_matches_meta[1356233945]", + "eval.tests.test_auto_basics.test_auto_mp3_audio_type_matches_meta[1434241304]", + "eval.tests.test_auto_basics.test_auto_mp3_audio_type_matches_meta[1463406864]", + "eval.tests.test_auto_basics.test_auto_mp3_audio_type_matches_meta[1481911318]", + "eval.tests.test_auto_basics.test_auto_mp3_audio_type_matches_meta[1832399351]", + "eval.tests.test_auto_basics.test_auto_output_does_not_contain_metadata_text_plain", + "eval.tests.test_auto_basics.test_auto_produces_exactly_one_output[1356233945]", + "eval.tests.test_auto_basics.test_auto_produces_exactly_one_output[583277]", + "eval.tests.test_auto_basics.test_auto_produces_exactly_one_output[807325]", + "eval.tests.test_auto_basics.test_auto_records_output_path_in_stdout", + "eval.tests.test_auto_basics.test_auto_source_file_unchanged", + "eval.tests.test_auto_flac_tags.test_flac_album_tag_from_metadata[1431343706]", + "eval.tests.test_auto_flac_tags.test_flac_album_tag_from_metadata[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_album_tag_from_metadata[509330088]", + "eval.tests.test_auto_flac_tags.test_flac_album_tag_from_metadata[583277]", + "eval.tests.test_auto_flac_tags.test_flac_album_tag_from_metadata[807325]", + "eval.tests.test_auto_flac_tags.test_flac_artist_tag_from_metadata[1431343706]", + "eval.tests.test_auto_flac_tags.test_flac_artist_tag_from_metadata[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_artist_tag_from_metadata[509330088]", + "eval.tests.test_auto_flac_tags.test_flac_artist_tag_from_metadata[583277]", + "eval.tests.test_auto_flac_tags.test_flac_artist_tag_from_metadata[807325]", + "eval.tests.test_auto_flac_tags.test_flac_description_always_has_tool_attribution", + "eval.tests.test_auto_flac_tags.test_flac_description_contains_comment_and_tool[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_description_contains_comment_and_tool[583277]", + "eval.tests.test_auto_flac_tags.test_flac_description_contains_comment_and_tool[807325]", + "eval.tests.test_auto_flac_tags.test_flac_description_distinct_from_title", + "eval.tests.test_auto_flac_tags.test_flac_embed_cover_front_picture[1431343706]", + "eval.tests.test_auto_flac_tags.test_flac_embed_cover_front_picture[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_embed_cover_front_picture[509330088]", + "eval.tests.test_auto_flac_tags.test_flac_embed_cover_front_picture[583277]", + "eval.tests.test_auto_flac_tags.test_flac_embed_cover_front_picture[807325]", + "eval.tests.test_auto_flac_tags.test_flac_keeps_encoded_audio_after_metadata", + "eval.tests.test_auto_flac_tags.test_flac_multi_comment_entry_order[583277]", + "eval.tests.test_auto_flac_tags.test_flac_multi_comment_entry_order[807325]", + "eval.tests.test_auto_flac_tags.test_flac_stderr_echoes_metadata", + "eval.tests.test_auto_flac_tags.test_flac_title_tag_from_music_name[1431343706]", + "eval.tests.test_auto_flac_tags.test_flac_title_tag_from_music_name[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_title_tag_from_music_name[509330088]", + "eval.tests.test_auto_flac_tags.test_flac_title_tag_from_music_name[583277]", + "eval.tests.test_auto_flac_tags.test_flac_title_tag_from_music_name[807325]", + "eval.tests.test_auto_flac_tags.test_flac_tool_tag_identifies_converter[1431343706]", + "eval.tests.test_auto_flac_tags.test_flac_tool_tag_identifies_converter[31654862]", + "eval.tests.test_auto_flac_tags.test_flac_tool_tag_identifies_converter[509330088]", + "eval.tests.test_auto_flac_tags.test_flac_tool_tag_identifies_converter[583277]", + "eval.tests.test_auto_flac_tags.test_flac_tool_tag_identifies_converter[807325]", + "eval.tests.test_auto_mp3_tags.test_mp3_apic_cover_picture[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_apic_cover_picture[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_apic_cover_picture[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_audio_mp3_frames_present", + "eval.tests.test_auto_mp3_tags.test_mp3_comm_original_comment_language_eng[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_comm_original_comment_language_eng[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_comm_original_comment_language_eng[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_comm_original_comment_language_eng[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_comm_original_comment_language_eng[1832399351]", + "eval.tests.test_auto_mp3_tags.test_mp3_metadata_not_in_plaintext", + "eval.tests.test_auto_mp3_tags.test_mp3_stderr_echoes_metadata", + "eval.tests.test_auto_mp3_tags.test_mp3_talb_album[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_talb_album[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_talb_album[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_talb_album[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_talb_album[1832399351]", + "eval.tests.test_auto_mp3_tags.test_mp3_tenc_encoder_tool[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_tenc_encoder_tool[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_tenc_encoder_tool[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_tenc_encoder_tool[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_tenc_encoder_tool[1832399351]", + "eval.tests.test_auto_mp3_tags.test_mp3_tit2_title[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_tit2_title[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_tit2_title[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_tit2_title[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_tit2_title[1832399351]", + "eval.tests.test_auto_mp3_tags.test_mp3_tpe1_artist[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_tpe1_artist[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_tpe1_artist[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_tpe1_artist[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_tpe1_artist[1832399351]", + "eval.tests.test_auto_mp3_tags.test_mp3_tsse_tool_attribution[1356233945]", + "eval.tests.test_auto_mp3_tags.test_mp3_tsse_tool_attribution[1434241304]", + "eval.tests.test_auto_mp3_tags.test_mp3_tsse_tool_attribution[1463406864]", + "eval.tests.test_auto_mp3_tags.test_mp3_tsse_tool_attribution[1481911318]", + "eval.tests.test_auto_mp3_tags.test_mp3_tsse_tool_attribution[1832399351]", + "eval.tests.test_cli_errors.test_absolute_missing_input_reports_full_path", + "eval.tests.test_cli_errors.test_almost_valid_header_truncated_key_rejected", + "eval.tests.test_cli_errors.test_directory_input_is_rejected", + "eval.tests.test_cli_errors.test_empty_file_is_rejected", + "eval.tests.test_cli_errors.test_garbage_file_header_rejects", + "eval.tests.test_cli_errors.test_input_with_bad_container_never_writes_output", + "eval.tests.test_cli_errors.test_missing_input_creates_no_output", + "eval.tests.test_cli_errors.test_missing_input_reports_path", + "eval.tests.test_cli_errors.test_tiny_non_ncm_file_is_rejected", + "eval.tests.test_cli_help.test_auto_then_dump_order_conflict", + "eval.tests.test_cli_help.test_dump_and_auto_are_mutually_exclusive", + "eval.tests.test_cli_help.test_explicit_auto_requires_no_prior_mode", + "eval.tests.test_cli_help.test_help_is_on_stdout_not_stderr", + "eval.tests.test_cli_help.test_help_long_flag_lists_modes", + "eval.tests.test_cli_help.test_help_mentions_default_auto_mode", + "eval.tests.test_cli_help.test_help_short_flag_lists_both_modes", + "eval.tests.test_cli_help.test_no_args_uses_auto_mode_and_succeeds", + "eval.tests.test_cli_help.test_unknown_long_flag_is_rejected", + "eval.tests.test_cli_help.test_unknown_short_flag_is_rejected", + "eval.tests.test_cli_help.test_version_does_not_require_input", + "eval.tests.test_cli_help.test_version_flag_exits_zero_even_with_input", + "eval.tests.test_cli_help.test_version_reports_crate_version", + "eval.tests.test_custom_meta.test_custom_flac_audio_stream_still_flac", + "eval.tests.test_custom_meta.test_custom_flac_tool_description_present", + "eval.tests.test_custom_meta.test_custom_mp3_tool_frames_present", + "eval.tests.test_custom_meta.test_empty_artist_produces_no_artist_vorbis", + "eval.tests.test_custom_meta.test_empty_artist_stderr_exact_golden", + "eval.tests.test_custom_meta.test_flac_string_music_id_vorbis", + "eval.tests.test_custom_meta.test_flac_strnum_produces_valid_flac", + "eval.tests.test_custom_meta.test_mp3_string_music_id_frames", + "eval.tests.test_custom_meta.test_multi_artist_title_and_album_preserved", + "eval.tests.test_custom_meta.test_multi_artist_yields_three_vorbis_values", + "eval.tests.test_custom_meta.test_music_id_boundary_value_echoed[flac_id0-0]", + "eval.tests.test_custom_meta.test_music_id_boundary_value_echoed[flac_idmax-4294967295]", + "eval.tests.test_custom_meta.test_music_id_max_stderr_exact_golden", + "eval.tests.test_custom_meta.test_music_id_zero_stderr_exact_golden", + "eval.tests.test_custom_meta.test_no_image_produces_no_picture_block", + "eval.tests.test_custom_meta.test_no_image_stdout_still_prints_output", + "eval.tests.test_custom_meta.test_numeric_string_music_id_echoed_verbatim[flac_strnum-509330088]", + "eval.tests.test_custom_meta.test_numeric_string_music_id_echoed_verbatim[mp3_strnum-222222]", + "eval.tests.test_custom_meta.test_string_music_id_converts_to_output[flac_str-flac]", + "eval.tests.test_custom_meta.test_string_music_id_converts_to_output[mp3_str-mp3]", + "eval.tests.test_custom_meta.test_string_music_id_echoed_to_stderr[flac_str-flac]", + "eval.tests.test_custom_meta.test_string_music_id_echoed_to_stderr[mp3_str-mp3]", + "eval.tests.test_custom_meta.test_string_music_id_stderr_exact_golden", + "eval.tests.test_dump_mode.test_dump_audio_is_raw_without_encoder_tags[583277]", + "eval.tests.test_dump_mode.test_dump_file_count_is_exact[1356233945]", + "eval.tests.test_dump_mode.test_dump_file_count_is_exact[583277]", + "eval.tests.test_dump_mode.test_dump_file_count_is_exact[807325]", + "eval.tests.test_dump_mode.test_dump_meta_and_key_are_distinct_files[1356233945]", + "eval.tests.test_dump_mode.test_dump_meta_and_key_are_distinct_files[583277]", + "eval.tests.test_dump_mode.test_dump_meta_and_key_are_distinct_files[807325]", + "eval.tests.test_dump_mode.test_dump_prints_input_path_to_stdout", + "eval.tests.test_dump_mode.test_dump_writes_comment_file[1356233945]", + "eval.tests.test_dump_mode.test_dump_writes_comment_file[583277]", + "eval.tests.test_dump_mode.test_dump_writes_comment_file[807325]", + "eval.tests.test_dump_mode.test_dump_writes_cover_image[1356233945]", + "eval.tests.test_dump_mode.test_dump_writes_cover_image[583277]", + "eval.tests.test_dump_mode.test_dump_writes_cover_image[807325]", + "eval.tests.test_dump_mode.test_dump_writes_json_meta_file[1356233945]", + "eval.tests.test_dump_mode.test_dump_writes_json_meta_file[583277]", + "eval.tests.test_dump_mode.test_dump_writes_json_meta_file[807325]", + "eval.tests.test_dump_mode.test_dump_writes_key_file[1356233945]", + "eval.tests.test_dump_mode.test_dump_writes_key_file[583277]", + "eval.tests.test_dump_mode.test_dump_writes_key_file[807325]", + "eval.tests.test_dump_mode.test_dump_writes_raw_audio_file[1356233945]", + "eval.tests.test_dump_mode.test_dump_writes_raw_audio_file[583277]", + "eval.tests.test_dump_mode.test_dump_writes_raw_audio_file[807325]", + "eval.tests.test_encoder_complement.test_empty_meta_echoes_meta_not_found_exact_golden", + "eval.tests.test_encoder_complement.test_empty_meta_stdout_has_no_meta_json", + "eval.tests.test_encoder_complement.test_empty_meta_still_prints_output_path", + "eval.tests.test_encoder_complement.test_empty_meta_writes_audio_untouched", + "eval.tests.test_encoder_complement.test_other_audio_passthrough_unchanged[m4a_audio-\\x00\\x00\\x00 ftypM4A -.m4a]", + "eval.tests.test_encoder_complement.test_other_audio_passthrough_unchanged[ogg_audio-OggS-.ogg]", + "eval.tests.test_encoder_complement.test_other_audio_passthrough_unchanged[unknown_audio-\\xde\\xad\\xbe\\xef-.audio]", + "eval.tests.test_encoder_complement.test_other_audio_still_deserializes_meta[m4a_audio-\\x00\\x00\\x00 ftypM4A -.m4a]", + "eval.tests.test_encoder_complement.test_other_audio_still_deserializes_meta[ogg_audio-OggS-.ogg]", + "eval.tests.test_encoder_complement.test_other_audio_still_deserializes_meta[unknown_audio-\\xde\\xad\\xbe\\xef-.audio]", + "eval.tests.test_encoder_complement.test_other_audio_uses_decoder_extension[m4a_audio-\\x00\\x00\\x00 ftypM4A -.m4a]", + "eval.tests.test_encoder_complement.test_other_audio_uses_decoder_extension[ogg_audio-OggS-.ogg]", + "eval.tests.test_encoder_complement.test_other_audio_uses_decoder_extension[unknown_audio-\\xde\\xad\\xbe\\xef-.audio]", + "eval.tests.test_encoder_complement.test_other_audio_with_image_drops_picture", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_album[807325]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_format[807325]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_id[807325]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_echoes_music_name[807325]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_is_not_empty_of_meta[807325]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1356233945]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1431343706]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1434241304]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1463406864]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1481911318]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[1832399351]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[31654862]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[509330088]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[583277]", + "eval.tests.test_meta_stderr.test_auto_stderr_matches_reference_json_fully[807325]", + "eval.tests.test_meta_stderr.test_auto_stdout_does_not_contain_meta_json", + "eval.tests.test_meta_stderr.test_dump_stderr_echoes_metadata[1434241304]", + "eval.tests.test_meta_stderr.test_dump_stderr_echoes_metadata[583277]", + "eval.tests.test_meta_stderr.test_dump_stderr_echoes_metadata[807325]", + "eval.tests.test_stdout_path.test_abs_input_echoes_abs_output_path", + "eval.tests.test_stdout_path.test_output_basename_duplicates_are_avoided_when_multiple_inputs", + "eval.tests.test_stdout_path.test_output_earned_from_renamed_input_capital_ext", + "eval.tests.test_stdout_path.test_output_extension_follows_audio_type_not_input", + "eval.tests.test_stdout_path.test_output_path_is_relative_when_input_relative", + "eval.tests.test_stdout_path.test_output_written_in_subdirectory_with_input", + "eval.tests.test_stdout_path.test_stdout_matches_output_filename", + "eval.tests.test_stdout_path.test_stdout_single_line_per_input" + ] + } + }, + "commit": "4faead9aaa0a6e143210d468715185db347dc66a", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 0.8773713458697738, + "eval_clean_hashes": [ + "fdd50802f417a1a6637e9109d83575660e11ce029465cf15f50c79e222d74516" + ], + "input_record": { + "codeql_db_mb": 96.44, + "codeql_status": true, + "codeql_time": 79.0291576278396, + "commit": "4faead9aaa0a6e143210d468715185db347dc66a", + "commits": 82, + "contributors": 3, + "difficulty": "easy", + "difficulty_code_lines": 754, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 754, + "difficulty_runtime_deps": 0, + "difficulty_score": 0.8773713458697738, + "difficulty_test_code_lines": 36, + "full_name": "magic-akari/ncmc", + "github_stars": 350, + "input_codeql_db": "rust_codeql/magic-akari__ncmc", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "agourlay/zip-password-finder", + "rank": 297, + "similarity": 0.5041593313217163 + } + ], + "repo_age": 7.97, + "repo_path": "rust/magic-akari__ncmc", + "rust_channel": "stable", + "rust_edition": "2021", + "rust_release_date": "2024-09-05", + "rust_version": "1.81.0", + "rust_version_source": "toolchain", + "source": "commit:4faead9aaa0a6e143210d468715185db347dc66a", + "status": "done", + "url": "https://github.com/magic-akari/ncmc" + }, + "instance_id": "magic-akari__ncmc.4faead9", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "magic-akari/ncmc" +} diff --git a/magic-akari--ncmc.4faead9/tests/test.sh b/magic-akari--ncmc.4faead9/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/magic-akari--ncmc.4faead9/tests/workspace.tar.gz b/magic-akari--ncmc.4faead9/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4052f84aaa2aef22fa55f5f0c65e93acbe35a5a0 --- /dev/null +++ b/magic-akari--ncmc.4faead9/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d8aee9c8bdac8387d5e62689ac110d8c5cfa99ae452e765bf11c39113fbbcad +size 230 diff --git a/magnet--metered-rs.f0d878e/environment/Dockerfile b/magnet--metered-rs.f0d878e/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/magnet--metered-rs.f0d878e/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/magnet--metered-rs.f0d878e/environment/download.sh b/magnet--metered-rs.f0d878e/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..4999ff6840b337a27029450c78ef87f495e8ae69 --- /dev/null +++ b/magnet--metered-rs.f0d878e/environment/download.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download stage for the metered-rs repository. +# +# This script is executed via: source /source_ro/download.sh +# It must be source-safe: it only exports environment variables and prefetches +# Cargo dependencies for the offline build stage. It performs no compilation, +# linking, packaging, or installation of build artifacts. +# +# The source tree is NOT mounted during this stage, so no repository file +# (Cargo.toml, Cargo.lock, etc.) is read. Every dependency requirement needed +# by the offline build of the 'metered-demo' target is transcribed inline below +# into a generated temporary manifest, and `cargo fetch --manifest-path` fills +# the shared Cargo registry cache that build.sh will consume offline. + +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source /source_ro/download.sh" + exit 2 +fi + +# Shared cargo locations. build.sh re-applies the same defaults so the offline +# build consumes the registry cache populated here. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}" + +# --------------------------------------------------------------------------- +# Prefetch all Cargo dependencies needed to build the in-repo demo binary. +# +# The demo crate (demos/Cargo.toml, package "metered-demo") depends on the +# metered library by path, which in turn depends on metered-macro. Their +# combined crates.io dependency requirements are reproduced below so the fetch +# resolution graph covers the full transitive closure the offline build needs. +# A minimal src/lib.rs stub satisfies cargo fetch, which never compiles code. +# --------------------------------------------------------------------------- +FETCH_DIR="$(mktemp -d)" +mkdir -p "$FETCH_DIR/src" +printf '\n' > "$FETCH_DIR/src/lib.rs" + +cat > "$FETCH_DIR/Cargo.toml" <<'EOF' +[package] +name = "metered-prefetch" +version = "0.0.0" +edition = "2018" + +[dependencies] +# metered deps (metered-macro is a path dep resolved from repo source at build) +aspect = "0.3" +hdrhistogram = "7.5" +atomic = "0.5" +parking_lot = "0.12" +serde = { version = "1.0", features = ["derive"] } +cfg-if = "1.0.0" +# metered-macro deps +syn = { version = "1.0", features = ["full"] } +aspect-weave = "0.2" +synattra = "0.2" +quote = "1.0" +proc-macro2 = "1.0" +heck = "0.4" +indexmap = "1.8" +# metered-demo deps +rand = "0.8" +tokio = { version = "1.19", features = ["rt", "rt-multi-thread", "time"] } +serde_prometheus = "0.1" +thiserror = "1.0" +EOF + +cargo fetch --manifest-path "$FETCH_DIR/Cargo.toml" +FETCH_STATUS=$? + +rm -rf "$FETCH_DIR" + +if [ "$FETCH_STATUS" -ne 0 ]; then + echo "cargo fetch failed with status $FETCH_STATUS" >&2 + return 1 +fi diff --git a/magnet--metered-rs.f0d878e/environment/executable b/magnet--metered-rs.f0d878e/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..769474a139c0e21e6c00c3cafb7c3363284a0fea --- /dev/null +++ b/magnet--metered-rs.f0d878e/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eee761062aeec0aa023ae37a7a10335e25a5fd8cb62eb8dc18009e25de7e8c57 +size 3296040 diff --git a/magnet--metered-rs.f0d878e/environment/harbor_prepare_download_env.sh b/magnet--metered-rs.f0d878e/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/magnet--metered-rs.f0d878e/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/magnet--metered-rs.f0d878e/environment/workspace.tar.gz b/magnet--metered-rs.f0d878e/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3640852be6dc3fdcab732b5e9bca9f8794f695cb --- /dev/null +++ b/magnet--metered-rs.f0d878e/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78ffc07a7fbf0b4950fe0a0ed347973e518453c24631a23b18058c5566a3a2c7 +size 13602 diff --git a/magnet--metered-rs.f0d878e/instruction.md b/magnet--metered-rs.f0d878e/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/magnet--metered-rs.f0d878e/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/magnet--metered-rs.f0d878e/solution/solve.sh b/magnet--metered-rs.f0d878e/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/magnet--metered-rs.f0d878e/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/magnet--metered-rs.f0d878e/task.toml b/magnet--metered-rs.f0d878e/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7f956a3c0f8733ea3153d05dfc9c322225fa76ea --- /dev/null +++ b/magnet--metered-rs.f0d878e/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/magnet--metered-rs.f0d878e" +description = "Synthetic ProgramGym cleanroom reconstruction task for magnet/metered-rs" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "magnet__metered-rs.f0d878e" +repository = "magnet/metered-rs" +commit = "f0d878e0042ec85a6da3fe7569397d942fdc91c7" +language = "rust" +difficulty = "easy" +difficulty_score = 1.4917817755841658 +test_branches = 3 +test_count = 503 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/magnet--metered-rs.f0d878e/tests/Dockerfile b/magnet--metered-rs.f0d878e/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_02.tar.gz b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5ac37788710070938102021c1463ac9bf966dc54 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bca24ed6d0ea35652c091e78fd87ed8e07307b24f211cd89e2e3223f8d02bcc4 +size 25427 diff --git a/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_03.tar.gz b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2fba6e26cff0835c5a091a31ca50b2eb82dae9ff --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1003202d70d81101e8cb2a87811fe4c20c0672cb15066c566ea102bc08978e8c +size 23123 diff --git a/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_04.tar.gz b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..03efe73535e160afcb51be971233909f01d54ae7 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a7203f1d96f36a313c3eef1c105848df37e741b850500465ab496714c5af430 +size 14522 diff --git a/magnet--metered-rs.f0d878e/tests/download.sh b/magnet--metered-rs.f0d878e/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..4999ff6840b337a27029450c78ef87f495e8ae69 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/download.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download stage for the metered-rs repository. +# +# This script is executed via: source /source_ro/download.sh +# It must be source-safe: it only exports environment variables and prefetches +# Cargo dependencies for the offline build stage. It performs no compilation, +# linking, packaging, or installation of build artifacts. +# +# The source tree is NOT mounted during this stage, so no repository file +# (Cargo.toml, Cargo.lock, etc.) is read. Every dependency requirement needed +# by the offline build of the 'metered-demo' target is transcribed inline below +# into a generated temporary manifest, and `cargo fetch --manifest-path` fills +# the shared Cargo registry cache that build.sh will consume offline. + +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source /source_ro/download.sh" + exit 2 +fi + +# Shared cargo locations. build.sh re-applies the same defaults so the offline +# build consumes the registry cache populated here. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}" + +# --------------------------------------------------------------------------- +# Prefetch all Cargo dependencies needed to build the in-repo demo binary. +# +# The demo crate (demos/Cargo.toml, package "metered-demo") depends on the +# metered library by path, which in turn depends on metered-macro. Their +# combined crates.io dependency requirements are reproduced below so the fetch +# resolution graph covers the full transitive closure the offline build needs. +# A minimal src/lib.rs stub satisfies cargo fetch, which never compiles code. +# --------------------------------------------------------------------------- +FETCH_DIR="$(mktemp -d)" +mkdir -p "$FETCH_DIR/src" +printf '\n' > "$FETCH_DIR/src/lib.rs" + +cat > "$FETCH_DIR/Cargo.toml" <<'EOF' +[package] +name = "metered-prefetch" +version = "0.0.0" +edition = "2018" + +[dependencies] +# metered deps (metered-macro is a path dep resolved from repo source at build) +aspect = "0.3" +hdrhistogram = "7.5" +atomic = "0.5" +parking_lot = "0.12" +serde = { version = "1.0", features = ["derive"] } +cfg-if = "1.0.0" +# metered-macro deps +syn = { version = "1.0", features = ["full"] } +aspect-weave = "0.2" +synattra = "0.2" +quote = "1.0" +proc-macro2 = "1.0" +heck = "0.4" +indexmap = "1.8" +# metered-demo deps +rand = "0.8" +tokio = { version = "1.19", features = ["rt", "rt-multi-thread", "time"] } +serde_prometheus = "0.1" +thiserror = "1.0" +EOF + +cargo fetch --manifest-path "$FETCH_DIR/Cargo.toml" +FETCH_STATUS=$? + +rm -rf "$FETCH_DIR" + +if [ "$FETCH_STATUS" -ne 0 ]; then + echo "cargo fetch failed with status $FETCH_STATUS" >&2 + return 1 +fi diff --git a/magnet--metered-rs.f0d878e/tests/executable b/magnet--metered-rs.f0d878e/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..769474a139c0e21e6c00c3cafb7c3363284a0fea --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eee761062aeec0aa023ae37a7a10335e25a5fd8cb62eb8dc18009e25de7e8c57 +size 3296040 diff --git a/magnet--metered-rs.f0d878e/tests/harbor_prepare_download_env.sh b/magnet--metered-rs.f0d878e/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/magnet--metered-rs.f0d878e/tests/programgym_evaluator.py b/magnet--metered-rs.f0d878e/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/magnet--metered-rs.f0d878e/tests/programgym_task.json b/magnet--metered-rs.f0d878e/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..c953e29f3696f1ab88890d8dc1bf2bc5da7b5fb2 --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/programgym_task.json @@ -0,0 +1,846 @@ +{ + "branches": { + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_serialization_structure_oracles.test_no_histogram_value_line_is_label_less", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_serialization_structure_oracles.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_atomic_backend_invariants.test_bar_error_count_is_subset_of_hits", + "eval.tests.test_atomic_backend_invariants.test_bar_response_samples_match_hits", + "eval.tests.test_atomic_backend_invariants.test_bare_block_has_exactly_two_lines", + "eval.tests.test_atomic_backend_invariants.test_baz_error_deterministic_single_failure", + "eval.tests.test_atomic_backend_invariants.test_bazium_has_zero_samples_never_called", + "eval.tests.test_atomic_backend_invariants.test_bazle_uses_variant_error_count_not_plain", + "eval.tests.test_atomic_backend_invariants.test_bir_has_only_in_flight", + "eval.tests.test_atomic_backend_invariants.test_biz_clear_produces_two_identical_hit_counts", + "eval.tests.test_atomic_backend_invariants.test_bor_and_bur_are_unmeasured", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/bar-hit_count-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/bar-response_time_samples-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/baz-response_time_samples-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/bazium-response_time_samples-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/bazle-hit_count-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metric_reg/foo-response_time_samples-1]", + "eval.tests.test_atomic_backend_invariants.test_count_series_serialized_with_expected_multiplicity[metrics/biz-hit_count-2]", + "eval.tests.test_atomic_backend_invariants.test_exit_guard_records_each_body_once", + "eval.tests.test_atomic_backend_invariants.test_foo_has_no_hit_count", + "eval.tests.test_atomic_backend_invariants.test_response_time_all_quantiles_within_bounds[metric_reg/bar]", + "eval.tests.test_atomic_backend_invariants.test_response_time_all_quantiles_within_bounds[metric_reg/baz]", + "eval.tests.test_atomic_backend_invariants.test_response_time_all_quantiles_within_bounds[metric_reg/bazium]", + "eval.tests.test_atomic_backend_invariants.test_response_time_all_quantiles_within_bounds[metric_reg/foo]", + "eval.tests.test_atomic_backend_invariants.test_response_time_mean_between_min_and_max[metric_reg/bar]", + "eval.tests.test_atomic_backend_invariants.test_response_time_mean_between_min_and_max[metric_reg/baz]", + "eval.tests.test_atomic_backend_invariants.test_response_time_mean_between_min_and_max[metric_reg/bazium]", + "eval.tests.test_atomic_backend_invariants.test_response_time_mean_between_min_and_max[metric_reg/foo]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_is_non_negative[metric_reg/bar]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_is_non_negative[metric_reg/baz]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_is_non_negative[metric_reg/bazium]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_is_non_negative[metric_reg/foo]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_le_max[metric_reg/bar]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_le_max[metric_reg/baz]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_le_max[metric_reg/bazium]", + "eval.tests.test_atomic_backend_invariants.test_response_time_min_le_max[metric_reg/foo]", + "eval.tests.test_atomic_backend_invariants.test_response_time_sample_count_is_exact[metric_reg/bar]", + "eval.tests.test_atomic_backend_invariants.test_response_time_sample_count_is_exact[metric_reg/baz]", + "eval.tests.test_atomic_backend_invariants.test_response_time_sample_count_is_exact[metric_reg/bazium]", + "eval.tests.test_atomic_backend_invariants.test_response_time_sample_count_is_exact[metric_reg/foo]", + "eval.tests.test_golden_oracle.test_all_counter_values_are_stable_nonnegative", + "eval.tests.test_golden_oracle.test_async_success_bodies_run_four_times", + "eval.tests.test_golden_oracle.test_bad_method_in_flight_balanced", + "eval.tests.test_golden_oracle.test_baz_in_flight_balanced_after_async", + "eval.tests.test_golden_oracle.test_deterministic_metric_block_matches_golden", + "eval.tests.test_golden_oracle.test_failure_variant_serialized_with_path_label", + "eval.tests.test_golden_oracle.test_golden_has_no_random_value_lines", + "eval.tests.test_golden_oracle.test_no_unexpected_failure_variant_counts", + "eval.tests.test_histogram_and_variant_oracles.test_bar_errors_are_fewer_than_response_samples", + "eval.tests.test_histogram_and_variant_oracles.test_bar_success_marker_count_is_seven", + "eval.tests.test_histogram_and_variant_oracles.test_bare_block_has_exactly_two_label_less_counters", + "eval.tests.test_histogram_and_variant_oracles.test_bazium_all_stats_default_to_zero", + "eval.tests.test_histogram_and_variant_oracles.test_error_variant_is_nested_collapse", + "eval.tests.test_histogram_and_variant_oracles.test_error_variant_skip_cleared_omits_never_occurred", + "eval.tests.test_histogram_and_variant_oracles.test_foo_success_marker_count_is_ten", + "eval.tests.test_histogram_and_variant_oracles.test_histogram_has_complete_stat_set[metric_reg/bar]", + "eval.tests.test_histogram_and_variant_oracles.test_histogram_has_complete_stat_set[metric_reg/baz]", + "eval.tests.test_histogram_and_variant_oracles.test_histogram_has_complete_stat_set[metric_reg/bazium]", + "eval.tests.test_histogram_and_variant_oracles.test_histogram_has_complete_stat_set[metric_reg/foo]", + "eval.tests.test_histogram_and_variant_oracles.test_quantile_labels_are_standard[metric_reg/bar]", + "eval.tests.test_histogram_and_variant_oracles.test_quantile_labels_are_standard[metric_reg/baz]", + "eval.tests.test_histogram_and_variant_oracles.test_quantile_labels_are_standard[metric_reg/bazium]", + "eval.tests.test_histogram_and_variant_oracles.test_quantile_labels_are_standard[metric_reg/foo]", + "eval.tests.test_histogram_and_variant_oracles.test_quantiles_are_non_decreasing[metric_reg/bar]", + "eval.tests.test_histogram_and_variant_oracles.test_quantiles_are_non_decreasing[metric_reg/baz]", + "eval.tests.test_histogram_and_variant_oracles.test_quantiles_are_non_decreasing[metric_reg/bazium]", + "eval.tests.test_histogram_and_variant_oracles.test_quantiles_are_non_decreasing[metric_reg/foo]", + "eval.tests.test_histogram_and_variant_oracles.test_uninvoked_methods_print_no_body_marker", + "eval.tests.test_metric_backends.test_all_in_flight_gauges_balanced_to_zero", + "eval.tests.test_metric_backends.test_bad_method_serializes_in_flight_zero", + "eval.tests.test_metric_backends.test_bar_error_count_is_three", + "eval.tests.test_metric_backends.test_bar_errors_are_nested_within_hits", + "eval.tests.test_metric_backends.test_bar_hit_count_is_ten", + "eval.tests.test_metric_backends.test_baz_error_count_is_one", + "eval.tests.test_metric_backends.test_bazle_failure_error_count_is_one", + "eval.tests.test_metric_backends.test_bazle_hit_count_is_five", + "eval.tests.test_metric_backends.test_biz_hit_count_printed_twice", + "eval.tests.test_metric_backends.test_biz_hit_count_reaches_1000_per_run", + "eval.tests.test_metric_backends.test_counter_lines_are_numeric_unsigned", + "eval.tests.test_metric_backends.test_error_count_counts_only_errors", + "eval.tests.test_metric_backends.test_error_stream_is_benign", + "eval.tests.test_metric_backends.test_every_measured_method_reaches_end", + "eval.tests.test_metric_backends.test_exit_success", + "eval.tests.test_metric_backends.test_hit_count_exceeds_error_count_on_successful_runs", + "eval.tests.test_metric_backends.test_in_flight_count_matches_expected_methods", + "eval.tests.test_metric_backends.test_in_flight_lines_present_for_each_method", + "eval.tests.test_metric_backends.test_measure_prints_expression_side_effect_twice", + "eval.tests.test_metric_backends.test_run_after_clear_restarts_counter_from_zero", + "eval.tests.test_metric_backends.test_serialization_kernel_deterministic", + "eval.tests.test_metric_backends.test_serialized_gauge_value_is_integer", + "eval.tests.test_metric_backends.test_stdout_is_non_empty", + "eval.tests.test_metric_backends.test_testmetrics_hit_count_is_five", + "eval.tests.test_metric_backends_parametrized.test_bare_metrics_totals", + "eval.tests.test_metric_backends_parametrized.test_counter_exact_value[error_count-path = \"metric_reg/bar\"-3]", + "eval.tests.test_metric_backends_parametrized.test_counter_exact_value[error_count-path = \"metric_reg/baz\"-1]", + "eval.tests.test_metric_backends_parametrized.test_counter_exact_value[hit_count-path = \"metric_reg/bar\"-10]", + "eval.tests.test_metric_backends_parametrized.test_counter_exact_value[hit_count-path = \"metric_reg/bazle\"-5]", + "eval.tests.test_metric_backends_parametrized.test_counter_exact_value[hit_count-path = \"metrics/biz\"-1000]", + "eval.tests.test_metric_backends_parametrized.test_each_counter_emitted_exactly_once", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/bad-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/bar-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/baz-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/bazium-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/bazle-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/bir-0]", + "eval.tests.test_metric_backends_parametrized.test_in_flight_gauge_balanced[metric_reg/foo-0]", + "eval.tests.test_metric_backends_parametrized.test_lib_error_variant_is_distinct_counter", + "eval.tests.test_metric_backends_parametrized.test_no_negative_counter_serialization", + "eval.tests.test_prose_and_section_sequence.test_async_bodies_interleave_as_success_pairs", + "eval.tests.test_prose_and_section_sequence.test_bare_serialized_series_come_only_from_simple_api", + "eval.tests.test_prose_and_section_sequence.test_biz_runs_are_preceded_by_their_prose_header", + "eval.tests.test_prose_and_section_sequence.test_first_biz_header_precedes_clear_between_runs", + "eval.tests.test_prose_and_section_sequence.test_in_flight_gauges_serialize_in_registry_order", + "eval.tests.test_prose_and_section_sequence.test_response_time_samples_serialize_in_method_order", + "eval.tests.test_prose_and_section_sequence.test_simple_api_bare_block_is_first_serialized_series", + "eval.tests.test_prose_and_section_sequence.test_sync_bar_failure_iterations_print_no_success_marker", + "eval.tests.test_prose_and_section_sequence.test_sync_loop_marker_sequence_is_exact", + "eval.tests.test_prose_and_section_sequence.test_sync_markers_complete_before_async_markers", + "eval.tests.test_prose_and_section_sequence.test_test_markers_precede_serialization_of_bare_block", + "eval.tests.test_serialization_structure_oracles.test_bare_block_precedes_labeled_blocks", + "eval.tests.test_serialization_structure_oracles.test_every_response_method_has_five_quantile_lines", + "eval.tests.test_serialization_structure_oracles.test_no_histogram_value_line_is_label_less", + "eval.tests.test_serialization_structure_oracles.test_response_quantile_labels_standard_across_all_methods", + "eval.tests.test_serialization_structure_oracles.test_second_biz_block_has_fresh_throughput_stat_set", + "eval.tests.test_serialization_structure_oracles.test_throughput_family_present_twice", + "eval.tests.test_serialization_structure_oracles.test_throughput_min_le_max_per_run", + "eval.tests.test_serialization_structure_oracles.test_throughput_quantile_labels_are_standard", + "eval.tests.test_serialization_structure_oracles.test_throughput_quantiles_nondecreasing_per_run", + "eval.tests.test_serialization_structure_oracles.test_throughput_quantiles_total_ten", + "eval.tests.test_serialization_structure_oracles.test_throughput_sample_counts_are_positive_integers", + "eval.tests.test_serialization_structure_oracles.test_two_biz_blocks_are_contiguous" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_global_structure_round5.test_metric_skeleton_matches_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_global_structure_round5.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_global_structure_round5.test_total_metric_rows_is_exactly_seventy_six", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_global_structure_round5.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_global_structure_round5.test_variant_label_dimension_only_on_baz_error_count", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_global_structure_round5.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_error_count.test_all_error_counts_are_nonnegative", + "eval.tests.test_error_count.test_bar_error_count_is_three", + "eval.tests.test_error_count.test_baz_async_error_count_is_one", + "eval.tests.test_error_count.test_bazle_error_count_labels", + "eval.tests.test_error_count.test_bazle_error_count_variant_present", + "eval.tests.test_error_count.test_bazle_error_count_variant_value_is_one", + "eval.tests.test_error_count.test_bazle_only_failure_variant_emitted", + "eval.tests.test_error_count.test_no_error_count_for_pure_success_registry", + "eval.tests.test_error_count.test_plain_top_level_error_count_is_one", + "eval.tests.test_exact_exports.test_each_exact_export_line_is_present", + "eval.tests.test_exact_exports.test_exact_line_present[baz_error_count{variant = \"Lib::Failure\", path = \"metric_reg/bazle\"} 1]", + "eval.tests.test_exact_exports.test_exact_line_present[error_count 1]", + "eval.tests.test_exact_exports.test_exact_line_present[error_count{path = \"metric_reg/bar\"} 3]", + "eval.tests.test_exact_exports.test_exact_line_present[error_count{path = \"metric_reg/baz\"} 1]", + "eval.tests.test_exact_exports.test_exact_line_present[hit_count 5]", + "eval.tests.test_exact_exports.test_exact_line_present[hit_count{path = \"metric_reg/bar\"} 10]", + "eval.tests.test_exact_exports.test_exact_line_present[hit_count{path = \"metric_reg/bazle\"} 5]", + "eval.tests.test_exact_exports.test_exact_line_present[hit_count{path = \"metrics/biz\"} 1000]", + "eval.tests.test_exact_exports.test_label_syntax_uses_spaces_around_equals", + "eval.tests.test_exact_exports.test_label_uses_double_quoted_path", + "eval.tests.test_exact_exports.test_no_top_level_path_label_on_plain_hit_count", + "eval.tests.test_exact_exports.test_plain_hit_count_line_before_plain_error_count", + "eval.tests.test_global_invariants.test_bar_zero_latency_percentile_small[0.95]", + "eval.tests.test_global_invariants.test_bar_zero_latency_percentile_small[0.9999]", + "eval.tests.test_global_invariants.test_bar_zero_latency_percentile_small[0.999]", + "eval.tests.test_global_invariants.test_bar_zero_latency_percentile_small[0.99]", + "eval.tests.test_global_invariants.test_bar_zero_latency_percentile_small[0.9]", + "eval.tests.test_global_invariants.test_baz_error_count_rows_carry_variant_and_path", + "eval.tests.test_global_invariants.test_bazium_empty_histogram_percentile_zero[0.95]", + "eval.tests.test_global_invariants.test_bazium_empty_histogram_percentile_zero[0.9999]", + "eval.tests.test_global_invariants.test_bazium_empty_histogram_percentile_zero[0.999]", + "eval.tests.test_global_invariants.test_bazium_empty_histogram_percentile_zero[0.99]", + "eval.tests.test_global_invariants.test_bazium_empty_histogram_percentile_zero[0.9]", + "eval.tests.test_global_invariants.test_every_export_value_is_nonnegative_int", + "eval.tests.test_global_invariants.test_every_path_label_is_a_known_registry", + "eval.tests.test_global_invariants.test_exported_family_names_is_exact_set", + "eval.tests.test_global_invariants.test_exported_path_labels_is_exact_set", + "eval.tests.test_global_invariants.test_in_flight_exported_exactly_once_per_measured_path", + "eval.tests.test_global_invariants.test_no_unknown_label_keys", + "eval.tests.test_global_invariants.test_plain_export_set_is_exactly_two_rows", + "eval.tests.test_global_invariants.test_response_time_rows_carry_both_quantile_and_path", + "eval.tests.test_global_invariants.test_throughput_exclusive_to_biz_registry", + "eval.tests.test_global_structure_round5.test_all_biz_rows_precede_all_metric_reg_rows", + "eval.tests.test_global_structure_round5.test_all_plain_metric_rows_precede_all_labeled_rows", + "eval.tests.test_global_structure_round5.test_bar_hit_count_equals_response_sample_count", + "eval.tests.test_global_structure_round5.test_bazle_hit_count_is_five", + "eval.tests.test_global_structure_round5.test_biz_hit_count_is_exactly_two_and_both_1000", + "eval.tests.test_global_structure_round5.test_distinct_path_label_first_occurrence_order_is_stable", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bad-error_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bad-hit_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bad-response_time]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/baz-hit_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bazium-error_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bazium-hit_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bazle-response_time]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bir-error_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bir-hit_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/bir-response_time]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/foo-error_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metric_reg/foo-hit_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metrics/biz-error_count]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metrics/biz-in_flight]", + "eval.tests.test_global_structure_round5.test_family_absent_for_path[metrics/biz-response_time]", + "eval.tests.test_global_structure_round5.test_metric_skeleton_matches_golden", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[-error_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[-hit_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bad-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-error_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-hit_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time-5]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time_max-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time_mean-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time_min-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time_samples-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bar-response_time_stdev-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-error_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time-5]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time_max-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time_mean-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time_min-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time_samples-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/baz-response_time_stdev-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time-5]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time_max-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time_mean-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time_min-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time_samples-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazium-response_time_stdev-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazle-baz_error_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazle-hit_count-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bazle-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/bir-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-in_flight-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time-5]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time_max-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time_mean-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time_min-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time_samples-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metric_reg/foo-response_time_stdev-1]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-hit_count-2]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput-10]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput_max-2]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput_mean-2]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput_min-2]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput_samples-2]", + "eval.tests.test_global_structure_round5.test_per_path_family_row_count_exact[metrics/biz-throughput_stdev-2]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[-2]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/bad-1]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/bar-13]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/baz-12]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/bazium-11]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/bazle-3]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/bir-1]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metric_reg/foo-11]", + "eval.tests.test_global_structure_round5.test_per_path_total_row_cardinality_exact[metrics/biz-22]", + "eval.tests.test_global_structure_round5.test_total_metric_rows_is_exactly_seventy_six", + "eval.tests.test_global_structure_round5.test_variant_label_dimension_only_on_baz_error_count", + "eval.tests.test_histogram.test_every_quantile_linear_in_level", + "eval.tests.test_histogram.test_histogram_family_exports_fixed_aggregates", + "eval.tests.test_histogram.test_histogram_mean_between_min_and_max", + "eval.tests.test_histogram.test_histogram_min_nonnegative_and_leq_max", + "eval.tests.test_histogram.test_histogram_paths_are_exhaustive_for_response_time", + "eval.tests.test_histogram.test_histogram_paths_are_exhaustive_for_throughput", + "eval.tests.test_histogram.test_histogram_quantile_family_count", + "eval.tests.test_histogram.test_histogram_quantile_labels_are_percentages", + "eval.tests.test_histogram.test_histogram_stdev_nonnegative", + "eval.tests.test_hit_count.test_all_hit_counts_are_unsigned_nonnegative", + "eval.tests.test_hit_count.test_bar_hit_count_is_ten", + "eval.tests.test_hit_count.test_bar_hit_count_labels", + "eval.tests.test_hit_count.test_bazle_hit_count_is_five", + "eval.tests.test_hit_count.test_bazle_hit_count_labels", + "eval.tests.test_hit_count.test_biz_first_hit_count_is_1000", + "eval.tests.test_hit_count.test_biz_hit_count_occurs_twice", + "eval.tests.test_hit_count.test_biz_second_hit_count_is_1000_after_clear", + "eval.tests.test_hit_count.test_hit_count_follows_biz_throughput_in_output", + "eval.tests.test_in_flight.test_in_flight_all_zero", + "eval.tests.test_in_flight.test_in_flight_bad_is_zero", + "eval.tests.test_in_flight.test_in_flight_bar_is_zero", + "eval.tests.test_in_flight.test_in_flight_baz_is_zero", + "eval.tests.test_in_flight.test_in_flight_bazium_is_zero", + "eval.tests.test_in_flight.test_in_flight_bazle_is_zero", + "eval.tests.test_in_flight.test_in_flight_bir_is_zero", + "eval.tests.test_in_flight.test_in_flight_exported_for_every_measured_method", + "eval.tests.test_in_flight.test_in_flight_exports_exactly_expected_paths", + "eval.tests.test_in_flight.test_in_flight_foo_is_zero", + "eval.tests.test_metric_types_per_path.test_bazium_registered_empty_histogram_present", + "eval.tests.test_metric_types_per_path.test_error_count_absent_for_response_time_only_foo", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/bad-expected6]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/bar-expected2]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/baz-expected3]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/bazium-expected4]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/bazle-expected5]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/bir-expected0]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metric_reg/foo-expected1]", + "eval.tests.test_metric_types_per_path.test_exact_metric_families_per_path[metrics/biz-expected7]", + "eval.tests.test_metric_types_per_path.test_hit_count_absent_for_async_baz", + "eval.tests.test_metric_types_per_path.test_never_called_measured_methods_gauge_balanced[metric_reg/bad]", + "eval.tests.test_metric_types_per_path.test_never_called_measured_methods_gauge_balanced[metric_reg/bir]", + "eval.tests.test_metric_types_per_path.test_response_time_absent_for_bazle", + "eval.tests.test_metric_types_per_path.test_throughput_only_registry_has_no_in_flight", + "eval.tests.test_metric_types_per_path.test_uncalled_methods_print_nothing[bad]", + "eval.tests.test_metric_types_per_path.test_uncalled_methods_print_nothing[bir]", + "eval.tests.test_metric_types_per_path.test_uncalled_methods_print_nothing[bor]", + "eval.tests.test_metric_types_per_path.test_uncalled_methods_print_nothing[bur]", + "eval.tests.test_metric_types_per_path.test_unmeasured_methods_export_no_metrics", + "eval.tests.test_ordering_and_relationships.test_bar_cross_field_arithmetic", + "eval.tests.test_ordering_and_relationships.test_baz_async_relationship", + "eval.tests.test_ordering_and_relationships.test_bazle_hit_count_is_total_calls", + "eval.tests.test_ordering_and_relationships.test_biz_hit_count_precedes_throughput_family", + "eval.tests.test_ordering_and_relationships.test_biz_throughput_quantiles_within_min_max[0]", + "eval.tests.test_ordering_and_relationships.test_biz_throughput_quantiles_within_min_max[1]", + "eval.tests.test_ordering_and_relationships.test_every_path_quantile_level_pinned", + "eval.tests.test_ordering_and_relationships.test_foo_quantile_leq_max[0.95]", + "eval.tests.test_ordering_and_relationships.test_foo_quantile_leq_max[0.9999]", + "eval.tests.test_ordering_and_relationships.test_foo_quantile_leq_max[0.999]", + "eval.tests.test_ordering_and_relationships.test_foo_quantile_leq_max[0.99]", + "eval.tests.test_ordering_and_relationships.test_foo_quantile_leq_max[0.9]", + "eval.tests.test_ordering_and_relationships.test_in_flight_precedes_path_response_time[metric_reg/bar]", + "eval.tests.test_ordering_and_relationships.test_in_flight_precedes_path_response_time[metric_reg/baz]", + "eval.tests.test_ordering_and_relationships.test_in_flight_precedes_path_response_time[metric_reg/bazium]", + "eval.tests.test_ordering_and_relationships.test_in_flight_precedes_path_response_time[metric_reg/foo]", + "eval.tests.test_ordering_and_relationships.test_no_duplicate_process_banner_metrics", + "eval.tests.test_ordering_and_relationships.test_none_count_is_never_exported", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/bad]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/bar]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/baz]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/bazium]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/bazle]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/bir]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metric_reg/foo]", + "eval.tests.test_ordering_and_relationships.test_path_families_appear_in_declaration_order[metrics/biz]", + "eval.tests.test_ordering_and_relationships.test_plain_hit_count_is_first_metric_in_output", + "eval.tests.test_ordering_and_relationships.test_plain_output_metric_names_is_exact_set", + "eval.tests.test_output_structure.test_async_demo_prints_baz_and_bazle", + "eval.tests.test_output_structure.test_clear_between_biz_phases", + "eval.tests.test_output_structure.test_every_export_line_is_parseable", + "eval.tests.test_output_structure.test_first_biz_phase_before_second", + "eval.tests.test_output_structure.test_metrics_biz_section_before_metric_reg_section", + "eval.tests.test_output_structure.test_output_has_no_carriage_returns", + "eval.tests.test_output_structure.test_simple_api_section_first", + "eval.tests.test_output_structure.test_sync_demo_prints_seven_bars", + "eval.tests.test_output_structure.test_sync_demo_prints_ten_foos", + "eval.tests.test_parametrized.test_baz_quantile_within_latency_bound[0.9999]", + "eval.tests.test_parametrized.test_baz_quantile_within_latency_bound[0.99]", + "eval.tests.test_parametrized.test_baz_quantile_within_latency_bound[0.9]", + "eval.tests.test_parametrized.test_biz_throughput_quantile_in_range[0.95]", + "eval.tests.test_parametrized.test_biz_throughput_quantile_in_range[0.99]", + "eval.tests.test_parametrized.test_biz_throughput_quantile_in_range[0.9]", + "eval.tests.test_parametrized.test_foo_quantile_within_latency_bound[0.9999]", + "eval.tests.test_parametrized.test_foo_quantile_within_latency_bound[0.99]", + "eval.tests.test_parametrized.test_foo_quantile_within_latency_bound[0.9]", + "eval.tests.test_parametrized.test_histogram_aggregates_present_via_family[metric_reg/bar]", + "eval.tests.test_parametrized.test_histogram_aggregates_present_via_family[metric_reg/baz]", + "eval.tests.test_parametrized.test_histogram_aggregates_present_via_family[metric_reg/bazium]", + "eval.tests.test_parametrized.test_histogram_aggregates_present_via_family[metric_reg/foo]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/bad]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/bar]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/baz]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/bazium]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/bazle]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/bir]", + "eval.tests.test_parametrized.test_in_flight_present_zero_single_label[metric_reg/foo]", + "eval.tests.test_parametrized.test_response_time_family_counts[metric_reg/bar]", + "eval.tests.test_parametrized.test_response_time_family_counts[metric_reg/baz]", + "eval.tests.test_parametrized.test_response_time_family_counts[metric_reg/bazium]", + "eval.tests.test_parametrized.test_response_time_family_counts[metric_reg/foo]", + "eval.tests.test_parametrized.test_response_time_quantile_labels[metric_reg/bar]", + "eval.tests.test_parametrized.test_response_time_quantile_labels[metric_reg/baz]", + "eval.tests.test_parametrized.test_response_time_quantile_labels[metric_reg/bazium]", + "eval.tests.test_parametrized.test_response_time_quantile_labels[metric_reg/foo]", + "eval.tests.test_response_time.test_aggregate_family_complete_for_every_path", + "eval.tests.test_response_time.test_bar_response_time_near_zero", + "eval.tests.test_response_time.test_baz_response_time_samples_positive", + "eval.tests.test_response_time.test_every_response_time_path_has_five_family_members", + "eval.tests.test_response_time.test_foo_response_time_max_le_sample_count_scale", + "eval.tests.test_response_time.test_foo_response_time_mean_between_min_and_max", + "eval.tests.test_response_time.test_foo_response_time_min_nonnegative", + "eval.tests.test_response_time.test_foo_response_time_samples_positive", + "eval.tests.test_response_time.test_quantile_family_present_for_bar", + "eval.tests.test_response_time.test_quantile_family_present_for_baz", + "eval.tests.test_response_time.test_quantile_family_present_for_bazium", + "eval.tests.test_response_time.test_quantile_family_present_for_foo", + "eval.tests.test_response_time.test_quantile_values_monotonic_non_decreasing_foo", + "eval.tests.test_response_time.test_response_time_samples_bar_is_ten", + "eval.tests.test_response_time.test_response_time_samples_baz_is_five", + "eval.tests.test_response_time.test_response_time_samples_bazium_is_zero", + "eval.tests.test_response_time.test_response_time_samples_foo_is_ten", + "eval.tests.test_smoke.test_exit_code_zero", + "eval.tests.test_smoke.test_prints_bootstrap_test_twice", + "eval.tests.test_smoke.test_stderr_is_empty", + "eval.tests.test_smoke.test_stdout_is_nonempty", + "eval.tests.test_smoke.test_top_level_error_count_value_is_one", + "eval.tests.test_smoke.test_top_level_hit_count_is_plain_five", + "eval.tests.test_smoke.test_top_level_hit_count_present", + "eval.tests.test_smoke.test_top_level_hit_count_value_is_five", + "eval.tests.test_throughput.test_biz_hit_count_pairs_with_throughput", + "eval.tests.test_throughput.test_clear_message_emitted", + "eval.tests.test_throughput.test_clear_resets_throughput_for_second_run", + "eval.tests.test_throughput.test_first_throughput_samples_positive", + "eval.tests.test_throughput.test_second_throughput_samples_positive", + "eval.tests.test_throughput.test_throughput_block_present_twice", + "eval.tests.test_throughput.test_throughput_deterministic_hit_count_after_clear", + "eval.tests.test_throughput.test_throughput_family_complete", + "eval.tests.test_throughput.test_throughput_max_within_tps_bound", + "eval.tests.test_throughput.test_throughput_min_nonnegative_and_leq_max", + "eval.tests.test_throughput.test_throughput_quantile_family_present", + "eval.tests.test_throughput.test_throughput_quantiles_monotonic" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_module_04.test_bar_error_count_exact", + "eval.tests.test_module_04.test_bar_error_count_is_exactly_three", + "eval.tests.test_module_04.test_bar_has_no_baz_error_count_variant_rows", + "eval.tests.test_module_04.test_bar_hit_count_exact", + "eval.tests.test_module_04.test_bar_quantile_rows_are_all_zero", + "eval.tests.test_module_04.test_bar_response_time_block_is_exactly_zero", + "eval.tests.test_module_04.test_bar_samples_row_precedes_stats", + "eval.tests.test_module_04.test_bar_success_prints_plus_errors_equal_total_calls", + "eval.tests.test_module_04.test_baz_error_count_exact", + "eval.tests.test_module_04.test_baz_success_prints_plus_errors_equal_total_calls", + "eval.tests.test_module_04.test_bazium_has_no_hit_or_error_rows", + "eval.tests.test_module_04.test_bazium_histogram_is_entirely_zero", + "eval.tests.test_module_04.test_bazium_in_flight_is_zero", + "eval.tests.test_module_04.test_bazium_uncalled_async_block_is_exactly_zero", + "eval.tests.test_module_04.test_bazle_error_variant_count_exact", + "eval.tests.test_module_04.test_bazle_has_no_plain_error_count_row", + "eval.tests.test_module_04.test_bazle_hit_count_exact", + "eval.tests.test_module_04.test_bazle_success_prints_plus_variant_errors_equal_total_hits", + "eval.tests.test_module_04.test_bazle_variant_breakdown_exact", + "eval.tests.test_module_04.test_bir_and_bad_do_not_print_success_lines", + "eval.tests.test_module_04.test_bir_and_bad_ship_only_inflight_gauge", + "eval.tests.test_module_04.test_bir_thr_before_baz_in_flight", + "eval.tests.test_module_04.test_biz_and_baz_registry_paths_are_disjoint", + "eval.tests.test_module_04.test_biz_block_has_only_hit_and_throughput_families", + "eval.tests.test_module_04.test_biz_block_opens_with_hit_count_before_throughput", + "eval.tests.test_module_04.test_biz_clear_transition_announced_between_runs", + "eval.tests.test_module_04.test_biz_emits_two_positive_throughput_sample_counts", + "eval.tests.test_module_04.test_biz_hit_count_appears_exactly_twice", + "eval.tests.test_module_04.test_biz_stage_announcement_lines_exact_order", + "eval.tests.test_module_04.test_deterministic_metric_counts_match_golden", + "eval.tests.test_module_04.test_distinct_metric_family_set_is_exact", + "eval.tests.test_module_04.test_each_biz_run_reemits_hit_counter[hit_count-1000]", + "eval.tests.test_module_04.test_error_count_value_exact[bar-3]", + "eval.tests.test_module_04.test_error_count_value_exact[baz-1]", + "eval.tests.test_module_04.test_every_generated_hit_count_carries_exact_path_label", + "eval.tests.test_module_04.test_every_measured_method_emits_exact_row_name_set", + "eval.tests.test_module_04.test_every_metric_row_carries_finite_numeric_value", + "eval.tests.test_module_04.test_exact_total_in_flight_gauge_rows", + "eval.tests.test_module_04.test_exits_successfully", + "eval.tests.test_module_04.test_first_biz_run_precedes_clear_announcement", + "eval.tests.test_module_04.test_foo_print_count_equals_sample_count", + "eval.tests.test_module_04.test_foo_response_time_obeys_min_mean_max", + "eval.tests.test_module_04.test_foo_response_time_quantiles_are_non_decreasing", + "eval.tests.test_module_04.test_golden_and_observed_count_maps_are_identical", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[bad]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[bar]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[baz]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[bazium]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[bazle]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[bir]", + "eval.tests.test_module_04.test_in_flight_gauge_balanced_to_zero[foo]", + "eval.tests.test_module_04.test_in_flight_is_first_row_of_every_metric_reg_block", + "eval.tests.test_module_04.test_inflight_only_methods_have_bare_registry[bad]", + "eval.tests.test_module_04.test_inflight_only_methods_have_bare_registry[bir]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[bad]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[bar]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[baz]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[bazium]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[bazle]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[bir]", + "eval.tests.test_module_04.test_metric_reg_block_row_name_order_exact[foo]", + "eval.tests.test_module_04.test_metric_reg_subregistries_appear_in_fixed_global_order", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[bad]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[bar]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[baz]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[bazium]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[bazle]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[bir]", + "eval.tests.test_module_04.test_metric_reg_subregistry_path_present[foo]", + "eval.tests.test_module_04.test_no_generated_row_lacks_a_path_label", + "eval.tests.test_module_04.test_output_uses_flat_text_row_layout", + "eval.tests.test_module_04.test_print_marker_emits_exact_frequency[bar !]", + "eval.tests.test_module_04.test_print_marker_emits_exact_frequency[baz !]", + "eval.tests.test_module_04.test_print_marker_emits_exact_frequency[bazle !]", + "eval.tests.test_module_04.test_print_marker_emits_exact_frequency[foo !]", + "eval.tests.test_module_04.test_print_marker_emits_exact_frequency[test !]", + "eval.tests.test_module_04.test_registry_block_covers_all_seven_methods", + "eval.tests.test_module_04.test_registry_method_blocks_appear_after_biz_throughput", + "eval.tests.test_module_04.test_response_time_block_supports_full_stat_set", + "eval.tests.test_module_04.test_response_time_emits_exact_quantile_label_set[baz]", + "eval.tests.test_module_04.test_response_time_emits_exact_quantile_label_set[bazium]", + "eval.tests.test_module_04.test_response_time_foo_emits_exact_quantile_set", + "eval.tests.test_module_04.test_response_time_foo_stats_are_numeric", + "eval.tests.test_module_04.test_response_time_metric_family_present[bar]", + "eval.tests.test_module_04.test_response_time_metric_family_present[baz]", + "eval.tests.test_module_04.test_response_time_metric_family_present[foo]", + "eval.tests.test_module_04.test_response_time_min_le_max_for_sample_method[baz]", + "eval.tests.test_module_04.test_response_time_min_le_max_for_sample_method[foo]", + "eval.tests.test_module_04.test_response_time_sample_count_exact[bar-10]", + "eval.tests.test_module_04.test_response_time_sample_count_exact[baz-5]", + "eval.tests.test_module_04.test_response_time_sample_count_exact[bazium-0]", + "eval.tests.test_module_04.test_response_time_sample_count_exact[foo-10]", + "eval.tests.test_module_04.test_sample_counts_by_method", + "eval.tests.test_module_04.test_second_biz_run_follows_clear_announcement", + "eval.tests.test_module_04.test_simple_block_precedes_biz_throughput", + "eval.tests.test_module_04.test_simple_counters_followed_by_blank_line_before_biz", + "eval.tests.test_module_04.test_simple_error_count_value", + "eval.tests.test_module_04.test_simple_hit_count_is_prints_plus_manual_incr", + "eval.tests.test_module_04.test_simple_hit_count_value", + "eval.tests.test_module_04.test_simple_rows_carry_no_path_label", + "eval.tests.test_module_04.test_simple_rows_have_no_registry_path", + "eval.tests.test_module_04.test_simple_test_print_emits_exactly_two_exact_lines", + "eval.tests.test_module_04.test_simple_test_prints_precede_cumulative_counters", + "eval.tests.test_module_04.test_stdout_is_multi_line_metric_dump", + "eval.tests.test_module_04.test_throughput_block_has_stat_set", + "eval.tests.test_module_04.test_throughput_emits_two_numeric_rows_per_quantile_dimension", + "eval.tests.test_module_04.test_unmeasured_and_uncalled_methods_never_print", + "eval.tests.test_module_04.test_writes_no_output_to_stderr" + ] + } + }, + "commit": "f0d878e0042ec85a6da3fe7569397d942fdc91c7", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.4917817755841658, + "eval_clean_hashes": [ + "eee761062aeec0aa023ae37a7a10335e25a5fd8cb62eb8dc18009e25de7e8c57" + ], + "input_record": { + "codeql_db_mb": 84.43, + "codeql_status": true, + "codeql_time": 38.667313328012824, + "commit": "f0d878e0042ec85a6da3fe7569397d942fdc91c7", + "commits": 109, + "contributors": 12, + "difficulty": "easy", + "difficulty_code_lines": 3103, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 3103, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.4917817755841658, + "difficulty_test_code_lines": 0, + "full_name": "magnet/metered-rs", + "github_stars": 344, + "input_codeql_db": "rust_codeql/magnet__metered-rs", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "pemistahl/grex", + "rank": 479, + "similarity": 0.4725656807422638 + }, + { + "pb_fullname": "BurntSushi/ripgrep", + "rank": 858, + "similarity": 0.39863401651382446 + }, + { + "pb_fullname": "nachoparker/dutree", + "rank": 796, + "similarity": 0.46303826570510864 + }, + { + "pb_fullname": "alexpovel/srgn", + "rank": 466, + "similarity": 0.4993286728858948 + }, + { + "pb_fullname": "rvben/rumdl", + "rank": 490, + "similarity": 0.4627220034599304 + }, + { + "pb_fullname": "dandavison/delta", + "rank": 847, + "similarity": 0.44704240560531616 + }, + { + "pb_fullname": "sharkdp/hyperfine", + "rank": 115, + "similarity": 0.5248571038246155 + }, + { + "pb_fullname": "orf/gping", + "rank": 857, + "similarity": 0.44378748536109924 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 510, + "similarity": 0.4640658497810364 + }, + { + "pb_fullname": "rust-embedded/svd2rust", + "rank": 110, + "similarity": 0.5559705495834351 + }, + { + "pb_fullname": "oppiliappan/eva", + "rank": 671, + "similarity": 0.4676697850227356 + }, + { + "pb_fullname": "WGUNDERWOOD/tex-fmt", + "rank": 670, + "similarity": 0.44447529315948486 + }, + { + "pb_fullname": "axodotdev/oranda", + "rank": 411, + "similarity": 0.5077309608459473 + }, + { + "pb_fullname": "cordx56/rustowl", + "rank": 32, + "similarity": 0.7005872130393982 + }, + { + "pb_fullname": "o2sh/onefetch", + "rank": 560, + "similarity": 0.4784850776195526 + }, + { + "pb_fullname": "nuta/nsh", + "rank": 963, + "similarity": 0.47622644901275635 + }, + { + "pb_fullname": "astro/deadnix", + "rank": 415, + "similarity": 0.49964168667793274 + }, + { + "pb_fullname": "wfxr/code-minimap", + "rank": 394, + "similarity": 0.540332555770874 + }, + { + "pb_fullname": "ast-grep/ast-grep", + "rank": 362, + "similarity": 0.5449181199073792 + }, + { + "pb_fullname": "unhappychoice/gittype", + "rank": 256, + "similarity": 0.5647132992744446 + }, + { + "pb_fullname": "rcoh/angle-grinder", + "rank": 805, + "similarity": 0.45986562967300415 + }, + { + "pb_fullname": "nikolassv/bartib", + "rank": 425, + "similarity": 0.45356521010398865 + }, + { + "pb_fullname": "KSXGitHub/parallel-disk-usage", + "rank": 947, + "similarity": 0.4461504817008972 + }, + { + "pb_fullname": "parcel-bundler/lightningcss", + "rank": 692, + "similarity": 0.45502278208732605 + }, + { + "pb_fullname": "rochacbruno/marmite", + "rank": 481, + "similarity": 0.43176084756851196 + }, + { + "pb_fullname": "konradsz/igrep", + "rank": 921, + "similarity": 0.45799702405929565 + }, + { + "pb_fullname": "hatoo/oha", + "rank": 890, + "similarity": 0.4946046769618988 + }, + { + "pb_fullname": "ecumene/rust-sloth", + "rank": 991, + "similarity": 0.4533143639564514 + }, + { + "pb_fullname": "mookid/diffr", + "rank": 777, + "similarity": 0.47638973593711853 + }, + { + "pb_fullname": "anordal/shellharden", + "rank": 791, + "similarity": 0.46452829241752625 + }, + { + "pb_fullname": "sharkdp/bat", + "rank": 858, + "similarity": 0.4625539779663086 + }, + { + "pb_fullname": "jrnxf/thokr", + "rank": 96, + "similarity": 0.5640792846679688 + }, + { + "pb_fullname": "wintermute-cell/ngrrram", + "rank": 863, + "similarity": 0.5141451358795166 + }, + { + "pb_fullname": "XAMPPRocky/tokei", + "rank": 561, + "similarity": 0.4320197105407715 + }, + { + "pb_fullname": "yoav-lavi/melody", + "rank": 296, + "similarity": 0.4853556752204895 + }, + { + "pb_fullname": "tree-sitter/tree-sitter", + "rank": 313, + "similarity": 0.49012452363967896 + }, + { + "pb_fullname": "YS-L/flamelens", + "rank": 400, + "similarity": 0.5056806802749634 + } + ], + "repo_age": 7.52, + "repo_path": "rust/magnet__metered-rs", + "rust_channel": "stable", + "rust_edition": "2018", + "rust_release_date": "2018-12-06", + "rust_version": "1.31.0", + "rust_version_source": "edition", + "source": "commit:f0d878e0042ec85a6da3fe7569397d942fdc91c7", + "status": "done", + "url": "https://github.com/magnet/metered-rs" + }, + "instance_id": "magnet__metered-rs.f0d878e", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "magnet/metered-rs" +} diff --git a/magnet--metered-rs.f0d878e/tests/test.sh b/magnet--metered-rs.f0d878e/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/magnet--metered-rs.f0d878e/tests/workspace.tar.gz b/magnet--metered-rs.f0d878e/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3640852be6dc3fdcab732b5e9bca9f8794f695cb --- /dev/null +++ b/magnet--metered-rs.f0d878e/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78ffc07a7fbf0b4950fe0a0ed347973e518453c24631a23b18058c5566a3a2c7 +size 13602 diff --git a/mahulchak--quickmerge.29c9272/environment/Dockerfile b/mahulchak--quickmerge.29c9272/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bcfa04437d24f8eb8652a133e82f9c25c0c57a0 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mahulchak--quickmerge.29c9272/environment/docker-compose.yaml b/mahulchak--quickmerge.29c9272/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mahulchak--quickmerge.29c9272/environment/download.sh b/mahulchak--quickmerge.29c9272/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..30e649926f5bee72e33b7ba0cae9f80c1ee40eba --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/download.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# QuickMERGE download/prefetch stage. +# +# The quickmerge product executable (merger/quickmerge) is a self-contained +# C++ program that needs only the standard C++ library and a working +# GNU toolchain per MUMmer/source. The build image already provides +# g++, gcc and GNU make, and the merger sources require no additional +# headers or third-party libraries, so there is nothing to prefetch here. +# +# This file is sourced (not executed) during the network stage: +# source /source_ro/download.sh +# It performs NO compile, link, configure, make, or test step. It only +# verifies the required toolchain executables are on PATH and exports the +# (single) environment variable that build.sh relies on. It is idempotent +# and safe to source from any directory. + +# Verify the toolchain is available. Do this explicitly so a missing +# compiler fails the download stage with a clear message instead of +# silently proceeding. +if ! command -v g++ >/dev/null; then + # g++ must be installed before the offline build stage. + # Explicitly install the minimal compilers and GNU make. + export DEBIAN_FRONTEND=noninteractive + apt-get update -y + apt-get install -y build-essential g++ gcc make +fi + +if ! command -v make >/dev/null; then + export DEBIAN_FRONTEND=noninteractive + apt-get update -y + apt-get install -y make +fi + +# Marker variable exported for the current shell so build.sh can rely on it. +# No repository file is read and no manifest is needed because the build +# is a plain GNU Make build of a single C++ target. +export QUICKMERGE_DOWNLOAD_STAGE=done diff --git a/mahulchak--quickmerge.29c9272/environment/executable b/mahulchak--quickmerge.29c9272/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..3c128eecd63d7726b25275311fbf1ea3f6f31cac --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d87bde62d462560ced64c96a144d06f73a5f33a5af0da01c1dfbf51538d6dbb2 +size 3169264 diff --git a/mahulchak--quickmerge.29c9272/environment/harbor_configure_apt_mirror.sh b/mahulchak--quickmerge.29c9272/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mahulchak--quickmerge.29c9272/environment/harbor_prepare_download_env.sh b/mahulchak--quickmerge.29c9272/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mahulchak--quickmerge.29c9272/environment/workspace.tar.gz b/mahulchak--quickmerge.29c9272/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a34728024f26b864040f9cb26a5ae2bce043587a --- /dev/null +++ b/mahulchak--quickmerge.29c9272/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fa60118b586d767681001f643e6c0cde5086da7af5547e3cfe1598a9a8146f2 +size 4003 diff --git a/mahulchak--quickmerge.29c9272/instruction.md b/mahulchak--quickmerge.29c9272/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mahulchak--quickmerge.29c9272/solution/solve.sh b/mahulchak--quickmerge.29c9272/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mahulchak--quickmerge.29c9272/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mahulchak--quickmerge.29c9272/task.toml b/mahulchak--quickmerge.29c9272/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8616009df5eb5a48b2789f5a3c2c3471829d5d8b --- /dev/null +++ b/mahulchak--quickmerge.29c9272/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mahulchak--quickmerge.29c9272" +description = "Synthetic ProgramGym cleanroom reconstruction task for mahulchak/quickmerge" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "mahulchak__quickmerge.29c9272" +repository = "mahulchak/quickmerge" +commit = "29c92723ca40525d20a1044bda5ea6b7b153f038" +language = "cpp" +difficulty = "medium" +difficulty_score = 2.503954023301783 +test_branches = 3 +test_count = 87 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mahulchak--quickmerge.29c9272/tests/Dockerfile b/mahulchak--quickmerge.29c9272/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef45becedb352d71e0d28eefebe80e3c73de2bd3 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/Dockerfile @@ -0,0 +1,72 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_01.tar.gz b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..341bab630138bd33c5064eeb9a1232452140372b --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fd4ebc0c569968ef582aceec625a845f85de476ca9dee7fb67601f6334de69a +size 10181 diff --git a/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_02.tar.gz b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3b95b2f96337d0f65eca30cb148caf8ef54f19c0 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1272206c5cd11028c633b078708fa419d77fc913ca71102987d021cefd6b27a6 +size 13197 diff --git a/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_03.tar.gz b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a426824ee6fef52094d599bb8cbbc6e5638837f2 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47e26d7bb3911e8cda12de637e15c9edd9a46266f4468301ba170ff19eede29f +size 10203 diff --git a/mahulchak--quickmerge.29c9272/tests/docker-compose.yaml b/mahulchak--quickmerge.29c9272/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mahulchak--quickmerge.29c9272/tests/download.sh b/mahulchak--quickmerge.29c9272/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..30e649926f5bee72e33b7ba0cae9f80c1ee40eba --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/download.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# QuickMERGE download/prefetch stage. +# +# The quickmerge product executable (merger/quickmerge) is a self-contained +# C++ program that needs only the standard C++ library and a working +# GNU toolchain per MUMmer/source. The build image already provides +# g++, gcc and GNU make, and the merger sources require no additional +# headers or third-party libraries, so there is nothing to prefetch here. +# +# This file is sourced (not executed) during the network stage: +# source /source_ro/download.sh +# It performs NO compile, link, configure, make, or test step. It only +# verifies the required toolchain executables are on PATH and exports the +# (single) environment variable that build.sh relies on. It is idempotent +# and safe to source from any directory. + +# Verify the toolchain is available. Do this explicitly so a missing +# compiler fails the download stage with a clear message instead of +# silently proceeding. +if ! command -v g++ >/dev/null; then + # g++ must be installed before the offline build stage. + # Explicitly install the minimal compilers and GNU make. + export DEBIAN_FRONTEND=noninteractive + apt-get update -y + apt-get install -y build-essential g++ gcc make +fi + +if ! command -v make >/dev/null; then + export DEBIAN_FRONTEND=noninteractive + apt-get update -y + apt-get install -y make +fi + +# Marker variable exported for the current shell so build.sh can rely on it. +# No repository file is read and no manifest is needed because the build +# is a plain GNU Make build of a single C++ target. +export QUICKMERGE_DOWNLOAD_STAGE=done diff --git a/mahulchak--quickmerge.29c9272/tests/executable b/mahulchak--quickmerge.29c9272/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..3c128eecd63d7726b25275311fbf1ea3f6f31cac --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d87bde62d462560ced64c96a144d06f73a5f33a5af0da01c1dfbf51538d6dbb2 +size 3169264 diff --git a/mahulchak--quickmerge.29c9272/tests/harbor_configure_apt_mirror.sh b/mahulchak--quickmerge.29c9272/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mahulchak--quickmerge.29c9272/tests/harbor_prepare_download_env.sh b/mahulchak--quickmerge.29c9272/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mahulchak--quickmerge.29c9272/tests/programgym_evaluator.py b/mahulchak--quickmerge.29c9272/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mahulchak--quickmerge.29c9272/tests/programgym_task.json b/mahulchak--quickmerge.29c9272/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..5dcda30398657f351eeee951cea3f011eade905a --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/programgym_task.json @@ -0,0 +1,182 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_quickmerge_main.test_anchor_chain_populates_lseq_table", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_quickmerge_main.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_argparse.test_argparser_echoes_each_token_with_index", + "eval.tests.test_argparse.test_argparser_flag_routing_runs_pipeline", + "eval.tests.test_argparse.test_missing_l_causes_abort", + "eval.tests.test_argparse.test_negative_l_accepted_as_integer", + "eval.tests.test_argparse.test_non_numeric_l_aborts", + "eval.tests.test_argparse.test_non_numeric_ml_aborts", + "eval.tests.test_cli_usage.test_dash_h_prints_help_even_with_full_args", + "eval.tests.test_cli_usage.test_double_dash_help_prints_help", + "eval.tests.test_cli_usage.test_no_arguments_prints_usage_and_fails", + "eval.tests.test_cli_usage.test_too_few_arguments_prints_usage", + "eval.tests.test_cli_usage.test_usage_exact_option_documentation", + "eval.tests.test_delta_parsing.test_delta_missing_coordinate_columns_reads_zero", + "eval.tests.test_delta_parsing.test_delta_without_marker_line_still_parses_headers", + "eval.tests.test_delta_parsing.test_header_only_delta_segfaults", + "eval.tests.test_delta_parsing.test_multiple_alignments_produce_distinct_rows", + "eval.tests.test_delta_parsing.test_param_summary_derives_metrics_from_coordinates", + "eval.tests.test_delta_parsing.test_reference_length_column_mirrors_numeric_column", + "eval.tests.test_delta_parsing.test_single_alignment_coordinates_roundtrip", + "eval.tests.test_prefix_and_defaults.test_default_hco_c_branches_when_omitted", + "eval.tests.test_prefix_and_defaults.test_explicit_hco_c_branches_when_provided", + "eval.tests.test_prefix_and_defaults.test_merged_fasta_produced_for_each_prefix", + "eval.tests.test_prefix_and_defaults.test_prefix_controls_all_artifact_names", + "eval.tests.test_prefix_and_defaults.test_two_prefixes_make_independent_sets", + "eval.tests.test_quickmerge_main.test_anchor_chain_populates_lseq_table", + "eval.tests.test_quickmerge_main.test_split_haplo_gate_clean_exit_persists_residuals", + "eval.tests.test_quickmerge_main.test_version_branch_reached_only_with_sufficient_argc" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_validation.test_help_flags_print_usage_and_exit_failure[--help]", + "eval.tests.test_cli_validation.test_help_flags_print_usage_and_exit_failure[-h]", + "eval.tests.test_cli_validation.test_help_short_and_long_flags_match_undersized_argv", + "eval.tests.test_cli_validation.test_unknown_trailing_tokens_are_ignored", + "eval.tests.test_cli_validation.test_usage_printed_with_no_arguments", + "eval.tests.test_cli_validation.test_version_flag_prints_version_and_exits_failure", + "eval.tests.test_merge_engine.test_chain_param_summary_records_both_extensions", + "eval.tests.test_merge_engine.test_chained_assembly_joins_three_contigs", + "eval.tests.test_merge_engine.test_chaining_stdout_reports_contig_order_and_orientations", + "eval.tests.test_merge_engine.test_default_cutoffs_keep_anchor_in_summary", + "eval.tests.test_merge_engine.test_empty_hybrid_fasta_yields_reference_only", + "eval.tests.test_merge_engine.test_forward_aln_summary_reports_delta_coords", + "eval.tests.test_merge_engine.test_forward_anchor_keeps_reference_contig", + "eval.tests.test_merge_engine.test_forward_moderate_both_overhang_no_overlap_value", + "eval.tests.test_merge_engine.test_forward_param_summary_exact_fields", + "eval.tests.test_merge_engine.test_forward_query_left_overhang_orientation_and_overlap", + "eval.tests.test_merge_engine.test_forward_query_longer_than_reference_both_sides_hang", + "eval.tests.test_merge_engine.test_forward_query_right_overhang_orientation_and_overlap", + "eval.tests.test_merge_engine.test_forward_start_right_half_orientation_L_and_chains", + "eval.tests.test_merge_engine.test_forward_start_right_half_orientation_R", + "eval.tests.test_merge_engine.test_high_hco_suppresses_anchor_and_passes_hybrid_through", + "eval.tests.test_merge_engine.test_large_c_overlap_cutoff_also_disables_chaining", + "eval.tests.test_merge_engine.test_large_ml_disables_chaining_keeps_contigs_separate", + "eval.tests.test_merge_engine.test_missing_delta_is_tolerated_and_hybrid_passes_through", + "eval.tests.test_merge_engine.test_moderate_c_enables_chaining_strict_hco_blocks_it", + "eval.tests.test_merge_engine.test_multiref_four_element_chain", + "eval.tests.test_merge_engine.test_multiref_left_bridge_first_element_is_other_reference", + "eval.tests.test_merge_engine.test_multiref_right_bridge_joins_two_references", + "eval.tests.test_merge_engine.test_reverse_bridge_flips_middle_query_orientation_to_minus_one", + "eval.tests.test_merge_engine.test_reverse_bridge_reverse_complements_terminal_reference", + "eval.tests.test_merge_engine.test_reverse_multi_block_lis_is_consolidated", + "eval.tests.test_merge_engine.test_reverse_query_left_overhang_reported_with_overhang", + "eval.tests.test_merge_engine.test_reverse_query_overhangs_both_reference_ends", + "eval.tests.test_merge_engine.test_reverse_query_right_overhang_reported_with_overhang", + "eval.tests.test_merge_engine.test_reverse_start_left_half_orientation_R", + "eval.tests.test_merge_engine.test_reverse_strand_innie_query_is_removed_from_merge", + "eval.tests.test_merge_engine.test_reverse_strand_innie_variant_reported_exactly", + "eval.tests.test_merge_engine.test_reverse_strand_reported_as_orientation_L", + "eval.tests.test_merge_engine.test_seed_length_cutoff_suppresses_anchor", + "eval.tests.test_merge_engine.test_single_alignment_emits_all_summary_files", + "eval.tests.test_merge_engine.test_two_blocks_are_transcribed_but_consolidated_to_one_overlap" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_checkaln_chains.test_chain_merged_fasta_concatenates_contigs", + "eval.tests.test_checkaln_chains.test_chain_versus_no_chain_stdout_differ", + "eval.tests.test_checkaln_chains.test_forward_chain_matches_exact_chain_dump", + "eval.tests.test_checkaln_chains.test_forward_chain_reports_merged_contig_length", + "eval.tests.test_checkaln_chains.test_multi_pair_no_scaffold_preserves_reference", + "eval.tests.test_checkaln_chains.test_no_chain_run_produces_no_lseq_dump", + "eval.tests.test_checkaln_chains.test_overhang_anchor_chain_anchors_at_query", + "eval.tests.test_checkaln_chains.test_reverse_chain_matches_exact_chain_dump", + "eval.tests.test_merge_pipeline.test_chain_run_emits_standard_output_headers", + "eval.tests.test_merge_pipeline.test_empty_delta_run_still_exits_zero", + "eval.tests.test_merge_pipeline.test_merged_fasta_matches_reference_for_simple_contig", + "eval.tests.test_merge_pipeline.test_missing_delta_file_produces_clean_exit_with_headers", + "eval.tests.test_merge_pipeline.test_prefix_controls_output_filenames_and_content", + "eval.tests.test_merge_pipeline.test_reverse_chain_emits_standard_output_headers", + "eval.tests.test_merge_pipeline.test_successful_run_creates_output_files", + "eval.tests.test_quickmerge_cli.test_argument_map_dumped_to_stdout_exactly", + "eval.tests.test_quickmerge_cli.test_help_long_flag_prints_exact_usage", + "eval.tests.test_quickmerge_cli.test_help_short_flag_prints_exact_usage", + "eval.tests.test_quickmerge_cli.test_no_arguments_prints_exact_usage", + "eval.tests.test_quickmerge_cli.test_too_few_arguments_prints_exact_usage", + "eval.tests.test_quickmerge_cli.test_version_flag_prints_exact_usage" + ] + } + }, + "commit": "29c92723ca40525d20a1044bda5ea6b7b153f038", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 2.503954023301783, + "eval_clean_hashes": [ + "d87bde62d462560ced64c96a144d06f73a5f33a5af0da01c1dfbf51538d6dbb2" + ], + "input_record": { + "commit": "29c92723ca40525d20a1044bda5ea6b7b153f038", + "full_name": "mahulchak/quickmerge", + "input_joern_zip": "cpp_joern/mahulchak__quickmerge.zip", + "joern_status": true, + "joern_time": 10.970857706852257, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 27, + "similarity": 0.5872014760971069 + } + ], + "repo_path": "cpp/mahulchak__quickmerge", + "source": "commit:29c92723ca40525d20a1044bda5ea6b7b153f038", + "status": "done", + "url": "https://github.com/mahulchak/quickmerge" + }, + "instance_id": "mahulchak__quickmerge.29c9272", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 6, + "branch_name": "generated_module_01", + "iteration_limit": 10, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_02", + "iteration_limit": 10, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 6, + "branch_name": "generated_module_03", + "iteration_limit": 10, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "mahulchak/quickmerge" +} diff --git a/mahulchak--quickmerge.29c9272/tests/test.sh b/mahulchak--quickmerge.29c9272/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mahulchak--quickmerge.29c9272/tests/workspace.tar.gz b/mahulchak--quickmerge.29c9272/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a34728024f26b864040f9cb26a5ae2bce043587a --- /dev/null +++ b/mahulchak--quickmerge.29c9272/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fa60118b586d767681001f643e6c0cde5086da7af5547e3cfe1598a9a8146f2 +size 4003 diff --git a/mailtutan--mailtutan.661a6be/environment/Dockerfile b/mailtutan--mailtutan.661a6be/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mailtutan--mailtutan.661a6be/environment/download.sh b/mailtutan--mailtutan.661a6be/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f45d5940795ddc07e46f0b4b8a277b7825e170f7 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/environment/download.sh @@ -0,0 +1,2682 @@ +#!/usr/bin/env bash +# ProgramGym download.sh for the mailtutan Rust workspace (mailtutan/mailtutan). +# +# Sourced as: source /source_ro/download.sh (network available, repo NOT mounted) +# Only this file is available, so it is fully self-contained: it embeds every +# Cargo manifest and the workspace Cargo.lock verbatim, reconstructs the workspace +# on disk under a temp dir, and prefetches the exact locked dependency set into +# the cargo registry cache. It performs no compile, link, test, package, or +# install step. +# +# The offline build.sh later runs `cargo build --offline --locked -p mailtutan` +# against the real repository copy, using exactly these locked versions. + +# Source-safe failure helper: return when sourced, exit when executed directly. +pb_fail() { + echo "download.sh: ERROR: $1" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Shared cargo home / target dir so build.sh (offline) sees this cache. +if [ -z "${CARGO_HOME:-}" ]; then + export CARGO_HOME="${HOME:-/workspace}/.cargo" +fi +if [ -z "${CARGO_TARGET_DIR:-}" ]; then + export CARGO_TARGET_DIR="target" +fi +if ! mkdir -p "$CARGO_HOME"; then + pb_fail "could not create CARGO_HOME=$CARGO_HOME" +fi + +# Reconstruct the workspace under a temp dir with the exact manifests + lock. +WORK=$(mktemp -d /tmp/pb-download.XXXXXX) +if [ -z "$WORK" ] || [ ! -d "$WORK" ]; then + pb_fail "mktemp -d failed" +fi +if ! mkdir -p "$WORK/mailtutan/src" "$WORK/mailtutan-lib/src" "$WORK/mailtutan-web/src"; then + pb_fail "could not create temp workspace layout" +fi +# --- workspace Cargo.toml (verbatim) --- +cat > "$WORK/Cargo.toml" << 'PBEOF_WORKSPACE_TOML' +[workspace.package] +authors = ["Mohsen Alizadeh "] +homepage= "https://github.com/mailtutan/mailtutan" +version = "0.3.0" +edition = "2021" +license = "MIT" +readme = "README.md" +keywords = ["email", "SMTP", "smtp-server", "wasm", "webassembly"] + +[profile.release] +opt-level = 'z' +lto = true +strip = true + +[workspace] +members = [ + "mailtutan", + "mailtutan-lib", + "mailtutan-web" +] + +[workspace.dependencies] +anyhow = "1.0.71" +chrono = "0.4.26" +PBEOF_WORKSPACE_TOML + +# --- mailtutan member manifest (verbatim) --- +cat > "$WORK/mailtutan/Cargo.toml" << 'PBEOF_MAILTUTAN_TOML' +[package] +name = "mailtutan" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "An SMTP server for test and development environments." + +[dependencies] +tokio = { version = "1.26", features = ["full"] } +async-trait = "0.1.67" +axum = { version = "0.6.18", features = ["ws"] } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" +mailin-embedded = "0.8.0" +chrono = { workspace = true } +futures = "0.3.28" +mailtutan-lib = { version = "0.3.0", path= "../mailtutan-lib" } +clap = { version = "4.3.0", features = ["derive", "env"] } +http = "0.2.9" +PBEOF_MAILTUTAN_TOML + +# --- mailtutan-lib member manifest (verbatim) --- +cat > "$WORK/mailtutan-lib/Cargo.toml" << 'PBEOF_LIB_TOML' +[package] +name = "mailtutan-lib" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "The library used in mailtutan project to implement an SMTP server for test and development environments." + +[dependencies] +tokio = "1.26" +async-trait = "0.1.67" +axum = { version = "0.6.18", features = ["ws", "headers"] } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" +mailin-embedded = "0.8.1" +mailin = "0.6.3" +chrono = { workspace = true } +futures = "0.3.28" +mail-parser = "0.8.2" +uuid = { version = "1.3.3", features = ["v4"] } +http-body = "0.4.5" +anyhow = { workspace = true } +reqwest = { version = "0.11.18", features = ["json"] } +PBEOF_LIB_TOML + +# --- mailtutan-web member manifest (verbatim) --- +cat > "$WORK/mailtutan-web/Cargo.toml" << 'PBEOF_WEB_TOML' +[package] +name = "mailtutan-web" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "The Frontend developed for mailtutan project which is an SMTP server for test and development environments." + +[dependencies] +yew = { version = "0.20.0", features = ["csr"] } +yewdux = "0.9" +serde_json = "1.0.81" +gloo-net = "0.2" +gloo-utils = "0.1.6" +gloo-dialogs = "0.1.1" +serde = { version = "1.0", features = ["derive"] } +wasm-bindgen-futures = "0.4" +futures = "0.3.28" +log = "0.4.6" +wasm-logger = "0.2.0" +url = "2.4.0" + +[dependencies.web-sys] +version = "0.3.63" +features = [ + "HtmlLiElement", + "HtmlTableCellElement", + "HtmlIFrameElement" +] +PBEOF_WEB_TOML + +# --- workspace Cargo.lock (verbatim; pins the exact dependency set) --- +cat > "$WORK/Cargo.lock" << 'PBEOF_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "anymap" +version = "1.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" + +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.21.0", + "bitflags 1.3.2", + "bytes", + "futures-util", + "headers", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64-compat" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" +dependencies = [ + "byteorder", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + +[[package]] +name = "bufstream-fresh" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1256011cfb2a52662513d3abad6feba26bd628060d8ba606de1245c96775ddb" + +[[package]] +name = "bumpalo" +version = "3.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "clap" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +dependencies = [ + "anstream", + "anstyle", + "bitflags 1.3.2", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gloo" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4bef6b277b3ab073253d4bca60761240cf8d6998f4bd142211957b69a61b20" +dependencies = [ + "gloo-console", + "gloo-dialogs", + "gloo-events", + "gloo-file", + "gloo-history", + "gloo-net", + "gloo-render", + "gloo-storage", + "gloo-timers", + "gloo-utils", + "gloo-worker", +] + +[[package]] +name = "gloo-console" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-file" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "gloo-events", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-history" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd451019e0b7a2b8a7a7b23e74916601abf1135c54664e57ff71dcc26dfcdeb7" +dependencies = [ + "gloo-events", + "gloo-utils", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-worker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" +dependencies = [ + "anymap2", + "bincode", + "gloo-console", + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.8.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "headers" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +dependencies = [ + "base64 0.13.1", + "bitflags 1.3.2", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "implicit-clone" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" +dependencies = [ + "indexmap 1.9.3", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "mail-parser" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4158a1c18963244e083888b21465846dfb68d6170850ed1ab4742edd57c9d47" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "mailin" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d685cc697caba9c320fd0be79835c49af79009fccf05e13200d988b07a24b429" +dependencies = [ + "base64-compat", + "either", + "log", + "nom", + "ternop", +] + +[[package]] +name = "mailin-embedded" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6634158f75ac027395ebf07b9a947e4164aed76e051bdc894ed94f6ff442157a" +dependencies = [ + "bufstream-fresh", + "cfg-if", + "log", + "mailin", + "rustls", + "rustls-pemfile", + "scoped_threadpool", +] + +[[package]] +name = "mailtutan" +version = "0.3.0" +dependencies = [ + "async-trait", + "axum", + "chrono", + "clap", + "futures", + "http", + "mailin-embedded", + "mailtutan-lib", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "mailtutan-lib" +version = "0.3.0" +dependencies = [ + "anyhow", + "async-trait", + "axum", + "chrono", + "futures", + "http-body", + "mail-parser", + "mailin", + "mailin-embedded", + "reqwest", + "serde", + "serde_json", + "tokio", + "uuid", +] + +[[package]] +name = "mailtutan-web" +version = "0.3.0" +dependencies = [ + "futures", + "gloo-dialogs", + "gloo-net", + "gloo-utils", + "log", + "serde", + "serde_json", + "url", + "wasm-bindgen-futures", + "wasm-logger", + "web-sys", + "yew", + "yewdux", +] + +[[package]] +name = "matchit" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" +dependencies = [ + "futures", + "rustversion", + "thiserror", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" +dependencies = [ + "futures", + "gloo", + "num_cpus", + "once_cell", + "pin-project", + "pinned", + "tokio", + "tokio-stream", + "wasm-bindgen-futures", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.3", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.3", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "ternop" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4ae32d0a4605a89c28534371b056919c12e7a070ee07505af75130ff030111" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "getrandom", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" + +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "yew" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" +dependencies = [ + "console_error_panic_hook", + "futures", + "gloo", + "implicit-clone", + "indexmap 1.9.3", + "js-sys", + "prokio", + "rustversion", + "serde", + "slab", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro", +] + +[[package]] +name = "yew-macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" +dependencies = [ + "boolinator", + "once_cell", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "yewdux" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c528544a814a0beb30059c8340eb78c88160141db788112b51a5a08098cef2d" +dependencies = [ + "anymap", + "async-trait", + "log", + "serde", + "serde_json", + "slab", + "thiserror", + "wasm-bindgen", + "web-sys", + "yew", + "yewdux-macros", +] + +[[package]] +name = "yewdux-macros" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc318072e34a9083d651ecd126153e9f1c39ae705794ef953a30b561b5eaab6d" +dependencies = [ + "darling", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] +PBEOF_LOCK + +# Minimal source stubs so the locked prefetch accepts the generated workspace. +# Only package/metadata is inspected, so empty modules suffice. +: > "$WORK/mailtutan/src/main.rs" +: > "$WORK/mailtutan-lib/src/lib.rs" +: > "$WORK/mailtutan-web/src/lib.rs" + +# Prefetch the exact locked crate set for the whole workspace into the cache. +# --manifest-path points cargo at the generated manifest (never the repo root); +# --locked matches the committed Cargo.lock, which build.sh uses with the same flag. +if ! cargo fetch --locked --manifest-path "$WORK/Cargo.toml"; then + pb_fail "could not populate the cargo registry cache (dependency prefetch step returned an error)" +fi + +echo "download.sh: OK -> cargo registry cache populated under $CARGO_HOME" diff --git a/mailtutan--mailtutan.661a6be/environment/executable b/mailtutan--mailtutan.661a6be/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..d2ad9602f815f178c248e824ccc48327c5a971d5 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cbdf15a87706b4881a59f0005c331d7af3161ada701caad9a1e359caa4c9400 +size 4204728 diff --git a/mailtutan--mailtutan.661a6be/environment/harbor_prepare_download_env.sh b/mailtutan--mailtutan.661a6be/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mailtutan--mailtutan.661a6be/environment/workspace.tar.gz b/mailtutan--mailtutan.661a6be/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c144e3a78de4b76c074ba2f8bdd1d0efce200028 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de7ffc33de01620ee6e643f716764de9fe64fe9dca551cbc8c416357ededb1c1 +size 263361 diff --git a/mailtutan--mailtutan.661a6be/instruction.md b/mailtutan--mailtutan.661a6be/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mailtutan--mailtutan.661a6be/solution/solve.sh b/mailtutan--mailtutan.661a6be/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mailtutan--mailtutan.661a6be/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mailtutan--mailtutan.661a6be/task.toml b/mailtutan--mailtutan.661a6be/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..92dbb19cb9dc64fb74777f67bfcb4ef99cf70c54 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mailtutan--mailtutan.661a6be" +description = "Synthetic ProgramGym cleanroom reconstruction task for mailtutan/mailtutan" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "mailtutan__mailtutan.661a6be" +repository = "mailtutan/mailtutan" +commit = "661a6be4e1c51cb3d9f750f78ab347ec127122da" +language = "rust" +difficulty = "easy" +difficulty_score = 1.1763806922432702 +test_branches = 4 +test_count = 845 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mailtutan--mailtutan.661a6be/tests/Dockerfile b/mailtutan--mailtutan.661a6be/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_01.tar.gz b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bbccd3e0f24852567130a27b07e63b0fcf19a720 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91f57439e8e13373877463e40387e3f6120bf1a7fd7e0559dbea06c592409946 +size 30881 diff --git a/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_02.tar.gz b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0cc2a5306edc8e3524aca70fcb55b233a5bfe5e2 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9524e5593809e0b6c44d3b95588ab88041280ae832a071e4afa79f2cff30f5b7 +size 32766 diff --git a/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_03.tar.gz b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..dc1aba1f3dd0b6ad113f62d0218f16c5b907485a --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:021e95e05613c3a9d90bb740fa5c05d6b5cd4e52f128eec6d8f90549b9d49ba6 +size 35708 diff --git a/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_04.tar.gz b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9189a59327d09a8faf6069b1ec5276e6ed9aac33 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e256a4d17d76e5bdb7c62197d5522ebc8bdf7f7540c64843f6138de4fd45a7e +size 27069 diff --git a/mailtutan--mailtutan.661a6be/tests/download.sh b/mailtutan--mailtutan.661a6be/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f45d5940795ddc07e46f0b4b8a277b7825e170f7 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/download.sh @@ -0,0 +1,2682 @@ +#!/usr/bin/env bash +# ProgramGym download.sh for the mailtutan Rust workspace (mailtutan/mailtutan). +# +# Sourced as: source /source_ro/download.sh (network available, repo NOT mounted) +# Only this file is available, so it is fully self-contained: it embeds every +# Cargo manifest and the workspace Cargo.lock verbatim, reconstructs the workspace +# on disk under a temp dir, and prefetches the exact locked dependency set into +# the cargo registry cache. It performs no compile, link, test, package, or +# install step. +# +# The offline build.sh later runs `cargo build --offline --locked -p mailtutan` +# against the real repository copy, using exactly these locked versions. + +# Source-safe failure helper: return when sourced, exit when executed directly. +pb_fail() { + echo "download.sh: ERROR: $1" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Shared cargo home / target dir so build.sh (offline) sees this cache. +if [ -z "${CARGO_HOME:-}" ]; then + export CARGO_HOME="${HOME:-/workspace}/.cargo" +fi +if [ -z "${CARGO_TARGET_DIR:-}" ]; then + export CARGO_TARGET_DIR="target" +fi +if ! mkdir -p "$CARGO_HOME"; then + pb_fail "could not create CARGO_HOME=$CARGO_HOME" +fi + +# Reconstruct the workspace under a temp dir with the exact manifests + lock. +WORK=$(mktemp -d /tmp/pb-download.XXXXXX) +if [ -z "$WORK" ] || [ ! -d "$WORK" ]; then + pb_fail "mktemp -d failed" +fi +if ! mkdir -p "$WORK/mailtutan/src" "$WORK/mailtutan-lib/src" "$WORK/mailtutan-web/src"; then + pb_fail "could not create temp workspace layout" +fi +# --- workspace Cargo.toml (verbatim) --- +cat > "$WORK/Cargo.toml" << 'PBEOF_WORKSPACE_TOML' +[workspace.package] +authors = ["Mohsen Alizadeh "] +homepage= "https://github.com/mailtutan/mailtutan" +version = "0.3.0" +edition = "2021" +license = "MIT" +readme = "README.md" +keywords = ["email", "SMTP", "smtp-server", "wasm", "webassembly"] + +[profile.release] +opt-level = 'z' +lto = true +strip = true + +[workspace] +members = [ + "mailtutan", + "mailtutan-lib", + "mailtutan-web" +] + +[workspace.dependencies] +anyhow = "1.0.71" +chrono = "0.4.26" +PBEOF_WORKSPACE_TOML + +# --- mailtutan member manifest (verbatim) --- +cat > "$WORK/mailtutan/Cargo.toml" << 'PBEOF_MAILTUTAN_TOML' +[package] +name = "mailtutan" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "An SMTP server for test and development environments." + +[dependencies] +tokio = { version = "1.26", features = ["full"] } +async-trait = "0.1.67" +axum = { version = "0.6.18", features = ["ws"] } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" +mailin-embedded = "0.8.0" +chrono = { workspace = true } +futures = "0.3.28" +mailtutan-lib = { version = "0.3.0", path= "../mailtutan-lib" } +clap = { version = "4.3.0", features = ["derive", "env"] } +http = "0.2.9" +PBEOF_MAILTUTAN_TOML + +# --- mailtutan-lib member manifest (verbatim) --- +cat > "$WORK/mailtutan-lib/Cargo.toml" << 'PBEOF_LIB_TOML' +[package] +name = "mailtutan-lib" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "The library used in mailtutan project to implement an SMTP server for test and development environments." + +[dependencies] +tokio = "1.26" +async-trait = "0.1.67" +axum = { version = "0.6.18", features = ["ws", "headers"] } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" +mailin-embedded = "0.8.1" +mailin = "0.6.3" +chrono = { workspace = true } +futures = "0.3.28" +mail-parser = "0.8.2" +uuid = { version = "1.3.3", features = ["v4"] } +http-body = "0.4.5" +anyhow = { workspace = true } +reqwest = { version = "0.11.18", features = ["json"] } +PBEOF_LIB_TOML + +# --- mailtutan-web member manifest (verbatim) --- +cat > "$WORK/mailtutan-web/Cargo.toml" << 'PBEOF_WEB_TOML' +[package] +name = "mailtutan-web" +authors.workspace = true +homepage.workspace = true +version.workspace = true +edition.workspace = true +license.workspace = true +readme.workspace = true +keywords.workspace = true +description = "The Frontend developed for mailtutan project which is an SMTP server for test and development environments." + +[dependencies] +yew = { version = "0.20.0", features = ["csr"] } +yewdux = "0.9" +serde_json = "1.0.81" +gloo-net = "0.2" +gloo-utils = "0.1.6" +gloo-dialogs = "0.1.1" +serde = { version = "1.0", features = ["derive"] } +wasm-bindgen-futures = "0.4" +futures = "0.3.28" +log = "0.4.6" +wasm-logger = "0.2.0" +url = "2.4.0" + +[dependencies.web-sys] +version = "0.3.63" +features = [ + "HtmlLiElement", + "HtmlTableCellElement", + "HtmlIFrameElement" +] +PBEOF_WEB_TOML + +# --- workspace Cargo.lock (verbatim; pins the exact dependency set) --- +cat > "$WORK/Cargo.lock" << 'PBEOF_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "anymap" +version = "1.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" + +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" +dependencies = [ + "async-trait", + "axum-core", + "base64 0.21.0", + "bitflags 1.3.2", + "bytes", + "futures-util", + "headers", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64-compat" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" +dependencies = [ + "byteorder", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + +[[package]] +name = "bufstream-fresh" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1256011cfb2a52662513d3abad6feba26bd628060d8ba606de1245c96775ddb" + +[[package]] +name = "bumpalo" +version = "3.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "clap" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +dependencies = [ + "anstream", + "anstyle", + "bitflags 1.3.2", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gloo" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4bef6b277b3ab073253d4bca60761240cf8d6998f4bd142211957b69a61b20" +dependencies = [ + "gloo-console", + "gloo-dialogs", + "gloo-events", + "gloo-file", + "gloo-history", + "gloo-net", + "gloo-render", + "gloo-storage", + "gloo-timers", + "gloo-utils", + "gloo-worker", +] + +[[package]] +name = "gloo-console" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-file" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "gloo-events", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-history" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd451019e0b7a2b8a7a7b23e74916601abf1135c54664e57ff71dcc26dfcdeb7" +dependencies = [ + "gloo-events", + "gloo-utils", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-worker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" +dependencies = [ + "anymap2", + "bincode", + "gloo-console", + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.8.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "headers" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +dependencies = [ + "base64 0.13.1", + "bitflags 1.3.2", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "implicit-clone" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" +dependencies = [ + "indexmap 1.9.3", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "mail-parser" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4158a1c18963244e083888b21465846dfb68d6170850ed1ab4742edd57c9d47" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "mailin" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d685cc697caba9c320fd0be79835c49af79009fccf05e13200d988b07a24b429" +dependencies = [ + "base64-compat", + "either", + "log", + "nom", + "ternop", +] + +[[package]] +name = "mailin-embedded" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6634158f75ac027395ebf07b9a947e4164aed76e051bdc894ed94f6ff442157a" +dependencies = [ + "bufstream-fresh", + "cfg-if", + "log", + "mailin", + "rustls", + "rustls-pemfile", + "scoped_threadpool", +] + +[[package]] +name = "mailtutan" +version = "0.3.0" +dependencies = [ + "async-trait", + "axum", + "chrono", + "clap", + "futures", + "http", + "mailin-embedded", + "mailtutan-lib", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "mailtutan-lib" +version = "0.3.0" +dependencies = [ + "anyhow", + "async-trait", + "axum", + "chrono", + "futures", + "http-body", + "mail-parser", + "mailin", + "mailin-embedded", + "reqwest", + "serde", + "serde_json", + "tokio", + "uuid", +] + +[[package]] +name = "mailtutan-web" +version = "0.3.0" +dependencies = [ + "futures", + "gloo-dialogs", + "gloo-net", + "gloo-utils", + "log", + "serde", + "serde_json", + "url", + "wasm-bindgen-futures", + "wasm-logger", + "web-sys", + "yew", + "yewdux", +] + +[[package]] +name = "matchit" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" +dependencies = [ + "futures", + "rustversion", + "thiserror", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" +dependencies = [ + "futures", + "gloo", + "num_cpus", + "once_cell", + "pin-project", + "pinned", + "tokio", + "tokio-stream", + "wasm-bindgen-futures", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.3", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.3", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "ternop" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4ae32d0a4605a89c28534371b056919c12e7a070ee07505af75130ff030111" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "getrandom", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" + +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "yew" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" +dependencies = [ + "console_error_panic_hook", + "futures", + "gloo", + "implicit-clone", + "indexmap 1.9.3", + "js-sys", + "prokio", + "rustversion", + "serde", + "slab", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro", +] + +[[package]] +name = "yew-macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" +dependencies = [ + "boolinator", + "once_cell", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "yewdux" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c528544a814a0beb30059c8340eb78c88160141db788112b51a5a08098cef2d" +dependencies = [ + "anymap", + "async-trait", + "log", + "serde", + "serde_json", + "slab", + "thiserror", + "wasm-bindgen", + "web-sys", + "yew", + "yewdux-macros", +] + +[[package]] +name = "yewdux-macros" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc318072e34a9083d651ecd126153e9f1c39ae705794ef953a30b561b5eaab6d" +dependencies = [ + "darling", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] +PBEOF_LOCK + +# Minimal source stubs so the locked prefetch accepts the generated workspace. +# Only package/metadata is inspected, so empty modules suffice. +: > "$WORK/mailtutan/src/main.rs" +: > "$WORK/mailtutan-lib/src/lib.rs" +: > "$WORK/mailtutan-web/src/lib.rs" + +# Prefetch the exact locked crate set for the whole workspace into the cache. +# --manifest-path points cargo at the generated manifest (never the repo root); +# --locked matches the committed Cargo.lock, which build.sh uses with the same flag. +if ! cargo fetch --locked --manifest-path "$WORK/Cargo.toml"; then + pb_fail "could not populate the cargo registry cache (dependency prefetch step returned an error)" +fi + +echo "download.sh: OK -> cargo registry cache populated under $CARGO_HOME" diff --git a/mailtutan--mailtutan.661a6be/tests/executable b/mailtutan--mailtutan.661a6be/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..d2ad9602f815f178c248e824ccc48327c5a971d5 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cbdf15a87706b4881a59f0005c331d7af3161ada701caad9a1e359caa4c9400 +size 4204728 diff --git a/mailtutan--mailtutan.661a6be/tests/harbor_prepare_download_env.sh b/mailtutan--mailtutan.661a6be/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mailtutan--mailtutan.661a6be/tests/programgym_evaluator.py b/mailtutan--mailtutan.661a6be/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mailtutan--mailtutan.661a6be/tests/programgym_task.json b/mailtutan--mailtutan.661a6be/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..f04a291f8fc1f8e9f2ab0ee0422218bf49fd845f --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/programgym_task.json @@ -0,0 +1,1520 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli.test_cli_port_overrides_env", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_cli.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_env_http_port_used_when_cli_absent", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_cli.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_http_port_too_large_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_env_port_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_ip_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_smtp_port_too_large_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_more.test_env_http_auth_username_default_admin", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_config_more.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_auth.test_http_auth_env_flag", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_http_auth.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module_edges.test_default_maildir_path_created_in_cwd", + "reasons": [ + { + "id": "test_time_dependency", + "message": "test appears to depend on wall-clock time", + "path": "eval/tests/test_module_edges.py", + "repair_hint": "Avoid wall-clock assertions or freeze/normalize time-dependent output.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module_edges.test_delete_nonexistent_id_drops_connection_but_survives", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_module_edges.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_serve_arm_reach.test_api_serve_arm_fires_on_http_bind_conflict", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_serve_arm_reach.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_serve_arm_reach.test_bind_conflict_process_not_killed_by_signal", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_serve_arm_reach.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_server.test_server_survives_missing_message_panic_request", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_server.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_shutdown.test_process_exits_on_stdin_close", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_shutdown.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_attachment.test_attachment_after_delete_single", + "eval.tests.test_attachment.test_attachment_download_content_type", + "eval.tests.test_attachment.test_attachment_download_preserves_content", + "eval.tests.test_attachment.test_attachment_download_returns_bytes", + "eval.tests.test_attachment.test_attachment_has_type_field", + "eval.tests.test_attachment.test_attachment_missing_cid_returns_empty_body", + "eval.tests.test_attachment.test_attachment_with_html_email", + "eval.tests.test_attachment.test_multiple_attachments_each_downloadable", + "eval.tests.test_attachment.test_single_attachment_listed", + "eval.tests.test_cli.test_cli_port_overrides_env", + "eval.tests.test_cli.test_env_http_port_used_when_cli_absent", + "eval.tests.test_cli.test_help_flag_exact_golden", + "eval.tests.test_cli.test_help_flag_succeeds[--help]", + "eval.tests.test_cli.test_help_flag_succeeds[-h]", + "eval.tests.test_cli.test_help_lists_default_credentials", + "eval.tests.test_cli.test_help_lists_default_ports", + "eval.tests.test_cli.test_help_lists_env_vars", + "eval.tests.test_cli.test_help_lists_storage_choices", + "eval.tests.test_cli.test_http_port_too_large_rejected", + "eval.tests.test_cli.test_invalid_env_messages_limit_rejected", + "eval.tests.test_cli.test_invalid_env_port_rejected", + "eval.tests.test_cli.test_invalid_env_storage_rejected", + "eval.tests.test_cli.test_invalid_ip_rejected", + "eval.tests.test_cli.test_invalid_storage_rejected", + "eval.tests.test_cli.test_messages_limit_non_numeric_rejected", + "eval.tests.test_cli.test_missing_flag_value_rejected", + "eval.tests.test_cli.test_non_numeric_ip_rejected", + "eval.tests.test_cli.test_non_numeric_port_rejected[--http-port---http-port ]", + "eval.tests.test_cli.test_non_numeric_port_rejected[--smtp-port---smtp-port ]", + "eval.tests.test_cli.test_smtp_auth_password_requires_cert_and_key", + "eval.tests.test_cli.test_smtp_auth_username_requires_cert_and_key", + "eval.tests.test_cli.test_smtp_port_too_large_rejected", + "eval.tests.test_cli.test_unknown_flag_rejected", + "eval.tests.test_cli.test_version_flag[--version]", + "eval.tests.test_cli.test_version_flag[-V]", + "eval.tests.test_config_edges.test_default_http_port_in_help", + "eval.tests.test_config_edges.test_default_smtp_port_in_help", + "eval.tests.test_config_edges.test_help_documents_http_credentials_env", + "eval.tests.test_config_edges.test_help_documents_maildir_flag", + "eval.tests.test_config_edges.test_help_documents_smtp_auth_env", + "eval.tests.test_config_edges.test_help_documents_storage_env", + "eval.tests.test_config_edges.test_help_documents_web_hook_flag", + "eval.tests.test_config_edges.test_ip_loopback_env_var_selects_listener", + "eval.tests.test_config_edges.test_messages_limit_zero_keeps_none", + "eval.tests.test_config_edges.test_web_hook_invalid_url_server_starts", + "eval.tests.test_config_more.test_cert_only_leaves_smtp_tls_disabled", + "eval.tests.test_config_more.test_env_auth_password_requires_cert_and_key", + "eval.tests.test_config_more.test_env_auth_username_requires_cert_and_key", + "eval.tests.test_config_more.test_env_http_auth_username_default_admin", + "eval.tests.test_config_more.test_key_only_leaves_smtp_tls_disabled", + "eval.tests.test_http_auth.test_apr1_style_header_without_auth_401", + "eval.tests.test_http_auth.test_auth_required_for_non_auth_request[/]", + "eval.tests.test_http_auth.test_auth_required_for_non_auth_request[/api/messages]", + "eval.tests.test_http_auth.test_auth_required_for_non_auth_request[/api/version]", + "eval.tests.test_http_auth.test_auth_required_for_non_auth_request[/styles.css]", + "eval.tests.test_http_auth.test_correct_credentials_ok", + "eval.tests.test_http_auth.test_correct_credentials_root_ok", + "eval.tests.test_http_auth.test_http_auth_env_flag", + "eval.tests.test_http_auth.test_http_auth_not_enabled_by_default", + "eval.tests.test_http_auth.test_wrong_credentials_rejected", + "eval.tests.test_http_auth.test_wrong_username_rejected", + "eval.tests.test_http_auth.test_www_authenticate_header_present", + "eval.tests.test_maildir_lifecycle.test_maildir_creates_directory_when_missing", + "eval.tests.test_maildir_lifecycle.test_maildir_delete_all_keeps_filesystem_clean", + "eval.tests.test_maildir_lifecycle.test_maildir_delete_all_then_resume_continues_sequence", + "eval.tests.test_maildir_lifecycle.test_maildir_get_single_preexisting", + "eval.tests.test_maildir_lifecycle.test_maildir_limit_eviction_persists_across_restart", + "eval.tests.test_maildir_lifecycle.test_maildir_list_reads_preexisting_eml", + "eval.tests.test_maildir_lifecycle.test_maildir_maildir_path_from_env", + "eval.tests.test_maildir_lifecycle.test_maildir_messages_survive_restart", + "eval.tests.test_maildir_lifecycle.test_maildir_non_directory_path_starts_fails", + "eval.tests.test_maildir_lifecycle.test_maildir_prepopulated_resume_uses_highest_sequence", + "eval.tests.test_maildir_lifecycle.test_maildir_restart_ids_continue_not_reset", + "eval.tests.test_module_edges.test_b64_encoded_subject_decoded", + "eval.tests.test_module_edges.test_default_ip_binds_0_0_0_0", + "eval.tests.test_module_edges.test_default_maildir_path_created_in_cwd", + "eval.tests.test_module_edges.test_delete_nonexistent_id_drops_connection_but_survives", + "eval.tests.test_module_edges.test_folded_subject_joins_continued_lines", + "eval.tests.test_module_edges.test_headers_only_message_stored", + "eval.tests.test_module_edges.test_message_without_subject_empty_string", + "eval.tests.test_module_edges.test_messages_limit_zero_evicts_all_immediately", + "eval.tests.test_module_edges.test_multi_recipient_to_yields_empty_list", + "eval.tests.test_module_edges.test_qp_body_decoded_in_plain_view", + "eval.tests.test_module_edges.test_qp_encoded_subject_decoded", + "eval.tests.test_module_edges.test_smtp_port_cli_overrides_env", + "eval.tests.test_module_edges.test_web_hook_unreachable_url_message_still_stored", + "eval.tests.test_protocol_edges.test_created_at_is_nonempty_timestamp", + "eval.tests.test_protocol_edges.test_formats_include_source_always", + "eval.tests.test_protocol_edges.test_html_endpoint_synthesizes_for_plain_text", + "eval.tests.test_protocol_edges.test_message_content_endpoints_have_content_type[/api/messages/1/eml]", + "eval.tests.test_protocol_edges.test_message_content_endpoints_have_content_type[/api/messages/1/plain]", + "eval.tests.test_protocol_edges.test_message_content_endpoints_have_content_type[/api/messages/1/source]", + "eval.tests.test_protocol_edges.test_message_detail_has_all_fields", + "eval.tests.test_protocol_edges.test_recipients_contains_delivered_address", + "eval.tests.test_protocol_edges.test_sender_recorded_as_display_address", + "eval.tests.test_protocol_edges.test_smtp_helo_returns_250", + "eval.tests.test_protocol_edges.test_smtp_help_returns_syntax_error", + "eval.tests.test_protocol_edges.test_smtp_noop_returns_250", + "eval.tests.test_protocol_edges.test_smtp_rset_returns_250", + "eval.tests.test_protocol_edges.test_smtp_vrfy_after_ehlo_returns_maybe", + "eval.tests.test_sender_edges.test_from_header_without_display_name_drops_connection", + "eval.tests.test_sender_edges.test_named_from_after_nameless_still_stores", + "eval.tests.test_sender_edges.test_no_subject_message_stores_empty_subject", + "eval.tests.test_sender_edges.test_server_survives_nameless_from_panic", + "eval.tests.test_serve_arm_reach.test_api_serve_arm_fires_on_http_bind_conflict", + "eval.tests.test_serve_arm_reach.test_bind_conflict_process_not_killed_by_signal", + "eval.tests.test_serve_arm_reach.test_both_ports_occupied_stills_exit_clean", + "eval.tests.test_serve_arm_reach.test_smtp_serve_arm_fires_on_smtp_bind_conflict", + "eval.tests.test_server.test_delete_all_then_list_empty", + "eval.tests.test_server.test_delete_empty_messages_returns_ok", + "eval.tests.test_server.test_empty_messages_list", + "eval.tests.test_server.test_public_endpoints_ok[/]", + "eval.tests.test_server.test_public_endpoints_ok[/api/version]", + "eval.tests.test_server.test_server_prints_listening_lines", + "eval.tests.test_server.test_server_survives_missing_message_panic_request", + "eval.tests.test_server.test_static_assets_served[/-text/html]", + "eval.tests.test_server.test_static_assets_served[/mailtutan-web.js-javascript]", + "eval.tests.test_server.test_static_assets_served[/mailtutan-web_bg.wasm-wasm]", + "eval.tests.test_server.test_static_assets_served[/styles.css-text/css]", + "eval.tests.test_server.test_unknown_routes_404[/api/nope]", + "eval.tests.test_server.test_unknown_routes_404[/favicon.ico]", + "eval.tests.test_server.test_unknown_routes_404[/missing]", + "eval.tests.test_server.test_unknown_routes_404[/nope]", + "eval.tests.test_server.test_version_endpoint_json", + "eval.tests.test_server.test_websocket_endpoint_without_upgrade_400", + "eval.tests.test_shutdown.test_process_exits_on_stdin_close", + "eval.tests.test_shutdown.test_sigint_after_activity_clean", + "eval.tests.test_shutdown.test_sigint_graceful_shutdown_exit_zero", + "eval.tests.test_shutdown.test_sigterm_terminates_by_signal", + "eval.tests.test_shutdown.test_two_sigints_still_exits", + "eval.tests.test_smtp_auth_flow.test_auth_login_correct_credentials", + "eval.tests.test_smtp_auth_flow.test_auth_login_missing_password_rejected", + "eval.tests.test_smtp_auth_flow.test_auth_login_then_send_requires_credentials_for_auth_only_flow", + "eval.tests.test_smtp_auth_flow.test_auth_login_wrong_password_rejected", + "eval.tests.test_smtp_auth_flow.test_auth_login_wrong_username_rejected", + "eval.tests.test_smtp_auth_flow.test_plain_no_tls_no_auth_extension", + "eval.tests.test_smtp_config.test_auth_server_accepts_credentials", + "eval.tests.test_smtp_config.test_cert_and_key_accept_paths[--smtp-cert-path]", + "eval.tests.test_smtp_config.test_cert_and_key_accept_paths[--smtp-key-path]", + "eval.tests.test_smtp_config.test_cert_and_key_start_ok", + "eval.tests.test_smtp_config.test_configured_auth_server_runs", + "eval.tests.test_smtp_config.test_implicit_starttls_handshake", + "eval.tests.test_smtp_config.test_plain_message_still_works_with_tls_enabled", + "eval.tests.test_smtp_config.test_plain_smtp_without_tls_no_auth_extension", + "eval.tests.test_smtp_config.test_smtp_auth_requires_both_cert_and_key_validation", + "eval.tests.test_smtp_config.test_tls_server_offers_starttls", + "eval.tests.test_smtp_flow.test_attachment_list_empty_for_text", + "eval.tests.test_smtp_flow.test_created_at_present", + "eval.tests.test_smtp_flow.test_delete_last_message", + "eval.tests.test_smtp_flow.test_delete_single_message", + "eval.tests.test_smtp_flow.test_each_message_format_endpoint_ok[eml]", + "eval.tests.test_smtp_flow.test_each_message_format_endpoint_ok[html]", + "eval.tests.test_smtp_flow.test_each_message_format_endpoint_ok[json]", + "eval.tests.test_smtp_flow.test_each_message_format_endpoint_ok[plain]", + "eval.tests.test_smtp_flow.test_each_message_format_endpoint_ok[source]", + "eval.tests.test_smtp_flow.test_get_eml_endpoint_ct", + "eval.tests.test_smtp_flow.test_get_html_endpoint", + "eval.tests.test_smtp_flow.test_get_json_endpoint", + "eval.tests.test_smtp_flow.test_get_plain_endpoint", + "eval.tests.test_smtp_flow.test_get_source_contains_body[ leading spaces ]", + "eval.tests.test_smtp_flow.test_get_source_contains_body[line1\\nline2\\nline3]", + "eval.tests.test_smtp_flow.test_get_source_contains_body[single body line]", + "eval.tests.test_smtp_flow.test_list_after_delete_all_is_empty", + "eval.tests.test_smtp_flow.test_message_gets_sequential_ids", + "eval.tests.test_smtp_flow.test_message_has_source_format", + "eval.tests.test_smtp_flow.test_message_id_present", + "eval.tests.test_smtp_flow.test_multipart_email_has_html_format", + "eval.tests.test_smtp_flow.test_plain_email_formats", + "eval.tests.test_smtp_flow.test_send_multiple_then_count", + "eval.tests.test_smtp_flow.test_sent_recipient_recorded", + "eval.tests.test_smtp_flow.test_sent_sender_recorded[Alice-alice@example.com-Alice alice@example.com]", + "eval.tests.test_smtp_flow.test_sent_sender_recorded[Bob-bob@example.com-Bob bob@example.com]", + "eval.tests.test_smtp_flow.test_sent_subject_is_listed[Hello]", + "eval.tests.test_smtp_flow.test_sent_subject_is_listed[Multi Word Subject]", + "eval.tests.test_smtp_flow.test_sent_subject_is_listed[Re: Test]", + "eval.tests.test_storage.test_large_message_limit_no_eviction", + "eval.tests.test_storage.test_maildir_limit_evicts_oldest", + "eval.tests.test_storage.test_messages_limit_evicts_oldest_memory", + "eval.tests.test_storage.test_messages_limit_one_keeps_only_last", + "eval.tests.test_storage.test_messages_limit_via_env", + "eval.tests.test_storage.test_storage_maildir_creates_eml_files", + "eval.tests.test_storage.test_storage_maildir_delete_all_removes_files", + "eval.tests.test_storage.test_storage_maildir_delete_removes_file", + "eval.tests.test_storage.test_storage_maildir_message_listed", + "eval.tests.test_storage.test_storage_maildir_sequential_files", + "eval.tests.test_storage.test_storage_memory_default", + "eval.tests.test_storage.test_storage_memory_explicit", + "eval.tests.test_web_hook.test_no_web_hook_means_no_post", + "eval.tests.test_web_hook.test_web_hook_body_is_message_event", + "eval.tests.test_web_hook.test_web_hook_delivers_for_each_message", + "eval.tests.test_web_hook.test_web_hook_env_var", + "eval.tests.test_web_hook.test_web_hook_receives_post_on_message", + "eval.tests.test_websocket.test_ws_broadcast_fans_out_to_multiple_subscribers", + "eval.tests.test_websocket.test_ws_event_message_matches_api_listing", + "eval.tests.test_websocket.test_ws_late_subscriber_gets_no_stale_broadcast", + "eval.tests.test_websocket.test_ws_late_subscriber_receives_next_message", + "eval.tests.test_websocket.test_ws_receives_add_event_on_new_message", + "eval.tests.test_websocket.test_ws_upgrade_handshake_101" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_smtp_auth_and_http_auth.test_http_auth_requires_valid_basic_credentials", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_smtp_auth_and_http_auth.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_smtp_config.test_default_smtp_port_is_1025", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_smtp_config.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_smtp_config.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_smtp_config.test_smtp_port_does_not_serve_http", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_smtp_config.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_smtp_auth.test_auth_advertised_after_tls", + "eval.tests.test_smtp_auth.test_auth_plain_case_sensitive_password_535", + "eval.tests.test_smtp_auth.test_auth_plain_case_sensitive_username_535", + "eval.tests.test_smtp_auth.test_auth_plain_correct_235", + "eval.tests.test_smtp_auth.test_auth_plain_empty_password_535", + "eval.tests.test_smtp_auth.test_auth_plain_whitespace_password_535", + "eval.tests.test_smtp_auth.test_auth_plain_wrong_password_535", + "eval.tests.test_smtp_auth.test_auth_plain_wrong_username_535", + "eval.tests.test_smtp_auth.test_mail_blocked_without_auth_after_tls", + "eval.tests.test_smtp_auth.test_message_submission_after_successful_auth", + "eval.tests.test_smtp_auth.test_rset_allowed_without_auth_after_tls", + "eval.tests.test_smtp_auth.test_starttls_advertised", + "eval.tests.test_smtp_auth.test_starttls_ready_220", + "eval.tests.test_smtp_auth_and_http_auth.test_auth_plain_before_starttls_rejected", + "eval.tests.test_smtp_auth_and_http_auth.test_auth_plain_correct_returns_235", + "eval.tests.test_smtp_auth_and_http_auth.test_auth_plain_re_auth_in_session_is_503", + "eval.tests.test_smtp_auth_and_http_auth.test_auth_plain_wrong_password_returns_535", + "eval.tests.test_smtp_auth_and_http_auth.test_help_notes_smtp_auth_requires_cert", + "eval.tests.test_smtp_auth_and_http_auth.test_http_auth_delete_all_requires_auth", + "eval.tests.test_smtp_auth_and_http_auth.test_http_auth_guards_message_listing", + "eval.tests.test_smtp_auth_and_http_auth.test_http_auth_rejects_wrong_password", + "eval.tests.test_smtp_auth_and_http_auth.test_http_auth_requires_valid_basic_credentials", + "eval.tests.test_smtp_auth_and_http_auth.test_smtp_auth_requires_cert_even_with_env", + "eval.tests.test_smtp_auth_and_http_auth.test_smtp_auth_username_requires_cert_path_args", + "eval.tests.test_smtp_auth_and_http_auth.test_unconfigured_server_rejects_auth_plain", + "eval.tests.test_smtp_config.test_custom_ports_used", + "eval.tests.test_smtp_config.test_default_smtp_port_is_1025", + "eval.tests.test_smtp_config.test_env_variable_ip_config", + "eval.tests.test_smtp_config.test_help_documents_smtp_auth_flags", + "eval.tests.test_smtp_config.test_help_documents_webhook_flag", + "eval.tests.test_smtp_config.test_help_exit_code_zero", + "eval.tests.test_smtp_config.test_help_stdout_matches_golden", + "eval.tests.test_smtp_config.test_http_port_serves_version", + "eval.tests.test_smtp_config.test_invalid_ip_value_rejected", + "eval.tests.test_smtp_config.test_invalid_smtp_port_value_rejected", + "eval.tests.test_smtp_config.test_invalid_storage_value_rejected", + "eval.tests.test_smtp_config.test_messages_limit_binds_store_size", + "eval.tests.test_smtp_config.test_smtp_port_does_not_serve_http", + "eval.tests.test_smtp_config.test_storage_maildir_writes_eml", + "eval.tests.test_smtp_config.test_unknown_flag_rejected", + "eval.tests.test_smtp_config.test_version_flag", + "eval.tests.test_smtp_config_more.test_cert_only_still_plain_smtp", + "eval.tests.test_smtp_config_more.test_delete_all_clears_messages", + "eval.tests.test_smtp_config_more.test_env_smtp_and_http_ports_used", + "eval.tests.test_smtp_config_more.test_invalid_http_port_value_rejected", + "eval.tests.test_smtp_config_more.test_maildir_limit_respected_on_disk", + "eval.tests.test_smtp_config_more.test_messages_limit_zero_keeps_none", + "eval.tests.test_smtp_config_more.test_short_help_flag_exits_zero", + "eval.tests.test_smtp_config_more.test_version_flags_long_and_short_match", + "eval.tests.test_smtp_data_end_parsing.test_attachment_content_id_roundtrip_via_parts_route", + "eval.tests.test_smtp_data_end_parsing.test_attachment_mime_type_is_major_part", + "eval.tests.test_smtp_data_end_parsing.test_attachment_unknown_cid_returns_empty", + "eval.tests.test_smtp_data_end_parsing.test_cc_header_not_copied_to_recipients", + "eval.tests.test_smtp_data_end_parsing.test_comma_separated_to_yields_empty_recipients", + "eval.tests.test_smtp_data_end_parsing.test_crlf_body_termination_exact", + "eval.tests.test_smtp_data_end_parsing.test_eml_endpoint_serves_raw_source", + "eval.tests.test_smtp_data_end_parsing.test_from_name_and_address_recorded", + "eval.tests.test_smtp_data_end_parsing.test_html_only_message_plain_view_falls_back_to_source", + "eval.tests.test_smtp_data_end_parsing.test_many_formats_marker_accumulates", + "eval.tests.test_smtp_data_end_parsing.test_multipart_alternative_plain_and_html_views", + "eval.tests.test_smtp_data_end_parsing.test_no_to_header_yields_empty_recipients", + "eval.tests.test_smtp_data_end_parsing.test_quoted_printable_body_decoded_in_plain", + "eval.tests.test_smtp_data_end_parsing.test_sender_includes_name_and_address", + "eval.tests.test_smtp_data_end_parsing.test_very_long_subject_preserved", + "eval.tests.test_smtp_edges.test_auth_plain_without_tls_rejected", + "eval.tests.test_smtp_edges.test_command_with_empty_arg_500", + "eval.tests.test_smtp_edges.test_data_body_extends_across_buffers", + "eval.tests.test_smtp_edges.test_data_without_envelope_503", + "eval.tests.test_smtp_edges.test_dot_stuffing_decoded", + "eval.tests.test_smtp_edges.test_empty_body_message_stored", + "eval.tests.test_smtp_edges.test_lowercase_ehlo_accepted", + "eval.tests.test_smtp_edges.test_mail_from_bad_address_syntax", + "eval.tests.test_smtp_edges.test_message_without_rcpt_rejected", + "eval.tests.test_smtp_edges.test_noop_250", + "eval.tests.test_smtp_edges.test_rcpt_before_mail_503", + "eval.tests.test_smtp_edges.test_rset_clears_envelope", + "eval.tests.test_smtp_edges.test_second_mail_before_completion_503", + "eval.tests.test_smtp_edges.test_two_messages_same_session", + "eval.tests.test_smtp_edges.test_unknown_command_500", + "eval.tests.test_smtp_handler_state_extra.test_data_buffer_accumulates_tiny_writes", + "eval.tests.test_smtp_handler_state_extra.test_env_sourced_smtp_auth_full_transaction", + "eval.tests.test_smtp_handler_state_extra.test_env_sourced_smtp_auth_rejects_wrong_credentials", + "eval.tests.test_smtp_handler_state_extra.test_key_only_still_plain_no_starttls", + "eval.tests.test_smtp_handler_state_extra.test_mail_from_body_param_accepted", + "eval.tests.test_smtp_handler_state_extra.test_message_submitted_over_tls_channel", + "eval.tests.test_smtp_handler_state_extra.test_smtp_auth_password_requires_cert_and_key_args", + "eval.tests.test_smtp_handler_state_extra.test_webhook_delivery_from_tls_auth_server", + "eval.tests.test_smtp_handler_state_extra.test_webhook_payload_omits_internal_buffers", + "eval.tests.test_smtp_message_content.test_attachment_listed", + "eval.tests.test_smtp_message_content.test_body_after_final_boundary_ignored", + "eval.tests.test_smtp_message_content.test_delete_message_removes_from_store", + "eval.tests.test_smtp_message_content.test_empty_subject_message", + "eval.tests.test_smtp_message_content.test_encoded_word_subject_decoded", + "eval.tests.test_smtp_message_content.test_html_body_detected", + "eval.tests.test_smtp_message_content.test_html_retrievable", + "eval.tests.test_smtp_message_content.test_multipart_alternative_sets_both_formats", + "eval.tests.test_smtp_message_content.test_multiple_messages_accumulate", + "eval.tests.test_smtp_message_content.test_no_from_header", + "eval.tests.test_smtp_message_content.test_repeated_subject_header_uses_last", + "eval.tests.test_smtp_message_content.test_utf8_subject_preserved", + "eval.tests.test_smtp_protocol.test_command_with_empty_ehlo_arg_500", + "eval.tests.test_smtp_protocol.test_data_input_prompt_354", + "eval.tests.test_smtp_protocol.test_data_message_accepted_250", + "eval.tests.test_smtp_protocol.test_data_without_envelope_503", + "eval.tests.test_smtp_protocol.test_ehlo_does_not_echo_argument_domain", + "eval.tests.test_smtp_protocol.test_ehlo_plain_extension_set", + "eval.tests.test_smtp_protocol.test_ehlo_returns_250", + "eval.tests.test_smtp_protocol.test_greeting_220", + "eval.tests.test_smtp_protocol.test_greeting_esmtp_banner", + "eval.tests.test_smtp_protocol.test_helo_accepted", + "eval.tests.test_smtp_protocol.test_lowercase_ehlo_accepted", + "eval.tests.test_smtp_protocol.test_mail_from_bad_address_syntax", + "eval.tests.test_smtp_protocol.test_mail_from_null_sender_syntax_error", + "eval.tests.test_smtp_protocol.test_mail_from_ok", + "eval.tests.test_smtp_protocol.test_message_formats_exact_set", + "eval.tests.test_smtp_protocol.test_message_id_is_sequential", + "eval.tests.test_smtp_protocol.test_message_json_ep_retrievable", + "eval.tests.test_smtp_protocol.test_message_persisted_in_api", + "eval.tests.test_smtp_protocol.test_message_recipients_parsed", + "eval.tests.test_smtp_protocol.test_message_sender_parsed", + "eval.tests.test_smtp_protocol.test_message_source_retrievable", + "eval.tests.test_smtp_protocol.test_message_subject_parsed", + "eval.tests.test_smtp_protocol.test_multiple_rcpt_to_accepted", + "eval.tests.test_smtp_protocol.test_noop_250", + "eval.tests.test_smtp_protocol.test_plain_body_retrievable", + "eval.tests.test_smtp_protocol.test_plain_message_html_view_renders_break", + "eval.tests.test_smtp_protocol.test_quit_returns_221", + "eval.tests.test_smtp_protocol.test_rcpt_before_mail_503", + "eval.tests.test_smtp_protocol.test_rcpt_to_ok", + "eval.tests.test_smtp_protocol.test_rset_clears_envelope", + "eval.tests.test_smtp_protocol.test_second_mail_blocked_until_completion", + "eval.tests.test_smtp_protocol.test_session_closes_after_quit", + "eval.tests.test_smtp_protocol.test_unknown_command_500", + "eval.tests.test_smtp_protocol_more.test_command_before_ehlo_200_line", + "eval.tests.test_smtp_protocol_more.test_data_body_with_multiple_dots_terminates_on_terminal_dot", + "eval.tests.test_smtp_protocol_more.test_empty_line_is_syntax_error", + "eval.tests.test_smtp_protocol_more.test_expn_is_syntax_error", + "eval.tests.test_smtp_protocol_more.test_extended_rcpt_parameter_rejected", + "eval.tests.test_smtp_protocol_more.test_helo_with_no_argument_is_500", + "eval.tests.test_smtp_protocol_more.test_help_is_syntax_error", + "eval.tests.test_smtp_protocol_more.test_lowercase_mail_rcpt_data_flow", + "eval.tests.test_smtp_protocol_more.test_mail_from_double_at_accepted", + "eval.tests.test_smtp_protocol_more.test_mail_from_esmtp_parameter_rejected", + "eval.tests.test_smtp_protocol_more.test_rset_without_envelope_ok", + "eval.tests.test_smtp_protocol_more.test_session_survives_unknown_command", + "eval.tests.test_smtp_protocol_more.test_spaces_only_line_is_syntax_error", + "eval.tests.test_smtp_protocol_more.test_vrfy_returns_252_maybe", + "eval.tests.test_web_hook.test_webhook_body_contains_recipients", + "eval.tests.test_web_hook.test_webhook_body_contains_sender", + "eval.tests.test_web_hook.test_webhook_body_contains_subject", + "eval.tests.test_web_hook.test_webhook_formats_plain_message", + "eval.tests.test_web_hook.test_webhook_multiple_messages_each_delivered", + "eval.tests.test_web_hook.test_webhook_no_delivery_when_not_configured", + "eval.tests.test_web_hook.test_webhook_posted_on_acceptance", + "eval.tests.test_web_hook.test_webhook_registers_message_id", + "eval.tests.test_web_hook.test_webhook_sends_valid_json", + "eval.tests.test_web_hook_content.test_webhook_attachment_filename", + "eval.tests.test_web_hook_content.test_webhook_attachment_type", + "eval.tests.test_web_hook_content.test_webhook_event_not_received_without_hook_config", + "eval.tests.test_web_hook_content.test_webhook_html_only_formats", + "eval.tests.test_web_hook_content.test_webhook_json_has_created_at", + "eval.tests.test_web_hook_content.test_webhook_maildir_storage_works", + "eval.tests.test_web_hook_more.test_webhook_attachment_event_fields", + "eval.tests.test_web_hook_more.test_webhook_created_at_nonempty_timestamp", + "eval.tests.test_web_hook_more.test_webhook_delete_does_not_trigger_new_post", + "eval.tests.test_web_hook_more.test_webhook_delivery_attempted_even_when_receiver_rejects", + "eval.tests.test_web_hook_more.test_webhook_event_fields_present", + "eval.tests.test_web_hook_more.test_webhook_maildir_backend_delivers", + "eval.tests.test_web_hook_more.test_webhook_multiple_rapid_deliveries_in_order", + "eval.tests.test_web_hook_more.test_webhook_uses_url_with_path_and_query" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_auth_malformed_basic.test_basic_without_space_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_bearer_scheme_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_empty_authorization_header_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_empty_password_after_colon_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_non_base64_payload_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_payload_without_colon_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_auth_malformed_basic.test_uppercase_scheme_variant_is_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_auth_malformed_basic.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_configuration.test_help_lists_http_auth_and_storage_flags_exact", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_configuration.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_version_api.test_version_works_when_no_messages_present", + "reasons": [ + { + "detail": "http.client.BadStatusLine: 220 localhost ESMTP", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_websocket_broadcast.test_ws_delivery_populates_maildir_storage", + "reasons": [ + { + "detail": "http.client.BadStatusLine: 220 localhost ESMTP", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_api_http_semantics.test_asset_filename_paths_are_not_registered", + "eval.tests.test_api_http_semantics.test_double_leading_slash_is_not_normalized", + "eval.tests.test_api_http_semantics.test_path_matching_is_case_sensitive", + "eval.tests.test_api_http_semantics.test_query_string_does_not_break_delete", + "eval.tests.test_api_http_semantics.test_query_string_is_ignored_on_api_routes", + "eval.tests.test_api_http_semantics.test_trailing_slash_is_not_matched", + "eval.tests.test_auth.test_auth_401_body_and_challenge_header", + "eval.tests.test_auth.test_auth_authorized_delete_succeeds", + "eval.tests.test_auth.test_auth_correct_credentials_granted", + "eval.tests.test_auth.test_auth_custom_credentials_default_example", + "eval.tests.test_auth.test_auth_disabled_serves_publicly[index]", + "eval.tests.test_auth.test_auth_disabled_serves_publicly[messages]", + "eval.tests.test_auth.test_auth_disabled_serves_publicly[version]", + "eval.tests.test_auth.test_auth_enabled_and_disabled_differ_on_same_route", + "eval.tests.test_auth.test_auth_protects_delete", + "eval.tests.test_auth.test_auth_protects_message_bodies", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[css]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[index]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[js]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[json]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[messages]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[version]", + "eval.tests.test_auth.test_auth_required_for_every_route_without_creds[wasm]", + "eval.tests.test_auth.test_auth_wrong_password_returns_401", + "eval.tests.test_auth.test_auth_wrong_username_returns_401", + "eval.tests.test_auth_env_config.test_env_auth_accepts_env_user_and_pass", + "eval.tests.test_auth_env_config.test_env_auth_enabled_blocks_anonymous", + "eval.tests.test_auth_env_config.test_env_auth_false_leaves_public", + "eval.tests.test_auth_env_config.test_env_auth_preserves_maildir_message_read", + "eval.tests.test_auth_env_config.test_env_auth_rejects_wrong_password", + "eval.tests.test_auth_env_config.test_env_defaults_remain_anonymous_declined", + "eval.tests.test_auth_grant_routes.test_authed_attachment_download_fallback_served", + "eval.tests.test_auth_grant_routes.test_authed_delete_all_succeeds", + "eval.tests.test_auth_grant_routes.test_authed_delete_single_succeeds", + "eval.tests.test_auth_grant_routes.test_authed_message_subresources_served", + "eval.tests.test_auth_grant_routes.test_authed_messages_list_served", + "eval.tests.test_auth_grant_routes.test_authed_static_assets_served", + "eval.tests.test_auth_grant_routes.test_authed_version_served", + "eval.tests.test_auth_grant_routes.test_authed_ws_upgrade_succeeds", + "eval.tests.test_auth_grant_routes.test_unauthorized_ws_upgrade_rejected_401", + "eval.tests.test_auth_malformed_basic.test_basic_without_space_is_rejected", + "eval.tests.test_auth_malformed_basic.test_bearer_scheme_is_rejected", + "eval.tests.test_auth_malformed_basic.test_empty_authorization_header_is_rejected", + "eval.tests.test_auth_malformed_basic.test_empty_password_after_colon_is_rejected", + "eval.tests.test_auth_malformed_basic.test_extra_whitespace_after_scheme_still_parses_correct_pair", + "eval.tests.test_auth_malformed_basic.test_non_base64_payload_is_rejected", + "eval.tests.test_auth_malformed_basic.test_payload_without_colon_is_rejected", + "eval.tests.test_auth_malformed_basic.test_uppercase_scheme_variant_is_rejected", + "eval.tests.test_cli_configuration.test_help_lists_http_auth_and_storage_flags_exact", + "eval.tests.test_cli_configuration.test_invalid_http_port_overflow_and_alpha_rejected_exact[non-numeric]", + "eval.tests.test_cli_configuration.test_invalid_http_port_overflow_and_alpha_rejected_exact[overflow]", + "eval.tests.test_cli_configuration.test_invalid_ip_value_rejected_with_exact_error", + "eval.tests.test_cli_configuration.test_invalid_storage_value_rejected_with_exact_error", + "eval.tests.test_cli_configuration.test_negative_http_port_rejected_with_exact_clap_error", + "eval.tests.test_cli_configuration.test_positional_argument_is_rejected_with_exact_clap_error", + "eval.tests.test_cli_configuration.test_short_version_flag_prints_exact_version", + "eval.tests.test_cli_configuration.test_smtp_auth_username_requires_cert_and_key_exact", + "eval.tests.test_cli_configuration.test_unknown_flag_is_rejected_with_exact_clap_error", + "eval.tests.test_cli_configuration.test_version_flag_prints_exact_version_and_exits_0", + "eval.tests.test_content_type_oracles.test_exact_content_type[/-text/html; charset=utf-8]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages-application/json]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages/1/eml-message/rfc822]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages/1/html-text/html;charset=utf-8]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages/1/json-application/json]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages/1/plain-text/plain;charset=utf-8]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/messages/1/source-text/plain;charset=utf-8]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/api/version-application/json]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/mailtutan-web.js-application/javascript;charset=utf-8]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/mailtutan-web_bg.wasm-application/wasm]", + "eval.tests.test_content_type_oracles.test_exact_content_type[/styles.css-text/css]", + "eval.tests.test_content_type_oracles.test_html_only_message_plain_render", + "eval.tests.test_content_type_oracles.test_javascript_content_type_has_charset_for_js_route", + "eval.tests.test_content_type_oracles.test_plain_only_message_html_render", + "eval.tests.test_content_type_oracles.test_plain_text_source_content_type_for_simple", + "eval.tests.test_delete_api.test_delete_all_empties_the_store", + "eval.tests.test_delete_api.test_delete_all_messages_returns_ok", + "eval.tests.test_delete_api.test_delete_all_on_empty_store_is_idempotent_200", + "eval.tests.test_delete_api.test_delete_missing_message_poisons_storage_lock", + "eval.tests.test_delete_api.test_delete_missing_message_resets_connection", + "eval.tests.test_delete_api.test_delete_non_numeric_id_returns_400", + "eval.tests.test_delete_api.test_delete_sequence_removes_in_any_order", + "eval.tests.test_delete_api.test_delete_single_message_returns_200", + "eval.tests.test_delete_api.test_delete_single_removes_that_message_only", + "eval.tests.test_delete_api.test_delete_then_get_source_resets", + "eval.tests.test_delete_api.test_get_messages_after_partial_delete", + "eval.tests.test_json_exact_oracles.test_json_attachment_cid_is_uuid_v4_form", + "eval.tests.test_json_exact_oracles.test_json_attachment_type_is_content_type", + "eval.tests.test_json_exact_oracles.test_json_cid_is_recomputed_on_each_get", + "eval.tests.test_json_exact_oracles.test_json_created_at_is_dated_format", + "eval.tests.test_json_exact_oracles.test_json_does_not_serialize_source_or_bodies", + "eval.tests.test_json_exact_oracles.test_json_formats_for_multipart_has_all_three", + "eval.tests.test_json_exact_oracles.test_json_formats_for_plain_message[simple]", + "eval.tests.test_json_exact_oracles.test_json_no_recipients_renders_empty_list", + "eval.tests.test_json_exact_oracles.test_json_no_subject_renders_empty_string", + "eval.tests.test_json_exact_oracles.test_json_recipients_mask_missing_to_header", + "eval.tests.test_json_exact_oracles.test_json_recipients_single", + "eval.tests.test_json_exact_oracles.test_json_sender_renders_name_and_address", + "eval.tests.test_json_exact_oracles.test_list_json_matches_get_json_for_same_message", + "eval.tests.test_memory_storage.test_memory_attachment_download_fallback", + "eval.tests.test_memory_storage.test_memory_delete_all_empties_store", + "eval.tests.test_memory_storage.test_memory_delete_removes_only_that_message", + "eval.tests.test_memory_storage.test_memory_delivered_message_listed", + "eval.tests.test_memory_storage.test_memory_eml_matches_source", + "eval.tests.test_memory_storage.test_memory_empty_list_returns_empty_array", + "eval.tests.test_memory_storage.test_memory_html_returns_html_body", + "eval.tests.test_memory_storage.test_memory_json_returns_message", + "eval.tests.test_memory_storage.test_memory_messages_limit_evicts_oldest_on_add", + "eval.tests.test_memory_storage.test_memory_missing_message_source_resets", + "eval.tests.test_memory_storage.test_memory_plain_returns_plain_body", + "eval.tests.test_memory_storage.test_memory_source_returns_exact_bytes", + "eval.tests.test_memory_storage.test_memory_version_still_serves", + "eval.tests.test_message_errors.test_get_missing_message_json_resets_connection", + "eval.tests.test_message_errors.test_get_missing_message_source_resets_connection", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/-1/json]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/eml]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/html]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/json]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/parts/x]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/plain]", + "eval.tests.test_message_errors.test_non_numeric_id_returns_400[/api/messages/abc/source]", + "eval.tests.test_message_errors.test_number_zero_message_id_resets_connection", + "eval.tests.test_message_errors.test_server_recovers_after_missing_message_panic", + "eval.tests.test_message_errors.test_unknown_route_returns_404[api-garbage]", + "eval.tests.test_message_errors.test_unknown_route_returns_404[api-ws]", + "eval.tests.test_message_errors.test_unknown_route_returns_404[root-garbage]", + "eval.tests.test_message_errors.test_unknown_route_returns_404[subresource-garbage]", + "eval.tests.test_message_errors.test_unsupported_method_on_api_messages_returns_405[OPTIONS]", + "eval.tests.test_message_errors.test_unsupported_method_on_api_messages_returns_405[PATCH]", + "eval.tests.test_message_errors.test_unsupported_method_on_api_messages_returns_405[POST]", + "eval.tests.test_message_errors.test_unsupported_method_on_api_messages_returns_405[PUT]", + "eval.tests.test_message_errors.test_very_large_message_id_resets_connection", + "eval.tests.test_message_transfer_encodings.test_8bit_html_body_is_double_encoded_exactly", + "eval.tests.test_message_transfer_encodings.test_base64_html_body_decoded_exactly", + "eval.tests.test_message_transfer_encodings.test_base64_plain_body_decoded_exactly", + "eval.tests.test_message_transfer_encodings.test_base64_short_plain_decoded_without_padding", + "eval.tests.test_message_transfer_encodings.test_iso8859_1_plain_body_decoded_to_utf8", + "eval.tests.test_message_transfer_encodings.test_multipart_alternative_inline_parts_served_as_body", + "eval.tests.test_message_transfer_encodings.test_quoted_printable_hex_escapes_decoded", + "eval.tests.test_message_transfer_encodings.test_quoted_printable_soft_line_break_removed", + "eval.tests.test_messages_attachments_api.test_attachment_filename_from_disposition", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[application-application0]", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[application-application1]", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[audio-audio]", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[image-image]", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[text-text]", + "eval.tests.test_messages_attachments_api.test_attachment_type_is_primary_ctype[video-video]", + "eval.tests.test_messages_attachments_api.test_attachment_without_filename_is_unknown", + "eval.tests.test_messages_attachments_api.test_download_cid_with_url_encoded_slash_reset", + "eval.tests.test_messages_attachments_api.test_download_on_message_with_no_attachments_empty", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[0]", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[@%21]", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[a1b2c3]", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[abc-123]", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[thing]", + "eval.tests.test_messages_attachments_api.test_download_unmatched_cid_returns_empty_rfc822[under_score]", + "eval.tests.test_messages_attachments_api.test_download_with_real_cid_still_empty", + "eval.tests.test_messages_attachments_api.test_multiple_attachments_all_listed", + "eval.tests.test_messages_download_and_encoding.test_download_after_delete_resets_then_recovered", + "eval.tests.test_messages_download_and_encoding.test_download_exact_content_type_and_no_disposition_no_attachment", + "eval.tests.test_messages_download_and_encoding.test_download_exact_content_type_unmatched_cid_with_attachments", + "eval.tests.test_messages_download_and_encoding.test_download_on_missing_id_resets_connection", + "eval.tests.test_messages_download_and_encoding.test_html_only_message_serves_both_plain_and_html", + "eval.tests.test_messages_download_and_encoding.test_show_eml_returns_exact_8bit_bytes_and_rfc822_type", + "eval.tests.test_messages_download_and_encoding.test_show_html_base64_decoded_exact", + "eval.tests.test_messages_download_and_encoding.test_show_plain_7bit_preserves_equals_and_spaces", + "eval.tests.test_messages_download_and_encoding.test_show_plain_8bit_unicode_double_encoded_exactly", + "eval.tests.test_messages_download_and_encoding.test_show_source_returns_exact_8bit_bytes", + "eval.tests.test_messages_download_and_encoding.test_source_and_eml_byte_identical", + "eval.tests.test_messages_get.test_attach_download_guessed_cid_still_empty", + "eval.tests.test_messages_get.test_attach_download_returns_200_fallback", + "eval.tests.test_messages_get.test_show_eml_matches_source", + "eval.tests.test_messages_get.test_show_html_returns_exact_html_body", + "eval.tests.test_messages_get.test_show_json_attachments_metadata", + "eval.tests.test_messages_get.test_show_json_message_without_to_has_empty_recipients", + "eval.tests.test_messages_get.test_show_json_returns_full_message", + "eval.tests.test_messages_get.test_show_json_unicode_roundtrip", + "eval.tests.test_messages_get.test_show_plain_returns_exact_plain_body", + "eval.tests.test_messages_get.test_show_plain_simple_message_body", + "eval.tests.test_messages_get.test_show_source_content_type_is_exact", + "eval.tests.test_messages_get.test_show_source_returns_exact_message_bytes", + "eval.tests.test_messages_id_boundaries.test_id_zero_resets_connection", + "eval.tests.test_messages_id_boundaries.test_in_range_but_absent_id_resets_connection[1234567890123456789]", + "eval.tests.test_messages_id_boundaries.test_in_range_but_absent_id_resets_connection[90000000000]", + "eval.tests.test_messages_id_boundaries.test_leading_zero_or_plus_padding_serves_id_one[+1]", + "eval.tests.test_messages_id_boundaries.test_leading_zero_or_plus_padding_serves_id_one[0001]", + "eval.tests.test_messages_id_boundaries.test_leading_zero_or_plus_padding_serves_id_one[01]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_on_delete_is_400", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_0-/eml]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_0-/html]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_0-/json]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_0-/plain]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_0-/source]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_1-/eml]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_1-/html]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_1-/json]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_1-/plain]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[184467440737_1-/source]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[999999999999-/eml]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[999999999999-/html]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[999999999999-/json]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[999999999999-/plain]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_returns_400_on_get_subroutes[999999999999-/source]", + "eval.tests.test_messages_id_boundaries.test_overflow_id_still_rejected_across_storage_backends", + "eval.tests.test_messages_id_boundaries.test_zero_value_token_resets_connection[000000]", + "eval.tests.test_messages_id_boundaries.test_zero_value_token_resets_connection[0]", + "eval.tests.test_messages_list.test_empty_store_returns_empty_array", + "eval.tests.test_messages_list.test_list_attachments_array_present", + "eval.tests.test_messages_list.test_list_created_at_field_present", + "eval.tests.test_messages_list.test_list_empty_subject_present_as_empty_string", + "eval.tests.test_messages_list.test_list_formats_for_plain_message", + "eval.tests.test_messages_list.test_list_message_contains_core_fields[formats]", + "eval.tests.test_messages_list.test_list_message_contains_core_fields[id]", + "eval.tests.test_messages_list.test_list_message_contains_core_fields[sender]", + "eval.tests.test_messages_list.test_list_message_contains_core_fields[subject]", + "eval.tests.test_messages_list.test_list_message_omits_source_and_binary_bodies", + "eval.tests.test_messages_list.test_list_reports_sender_and_recipients", + "eval.tests.test_messages_list.test_single_message_list", + "eval.tests.test_messages_list.test_two_messages_list_both_present", + "eval.tests.test_messages_malformed_store.test_binary_garbage_parses_to_empty_model", + "eval.tests.test_messages_malformed_store.test_crlf_only_json_serializes_degenerate_model", + "eval.tests.test_messages_malformed_store.test_crlf_only_parses_to_empty_model", + "eval.tests.test_messages_malformed_store.test_degenerate_json_plain_and_html_reset", + "eval.tests.test_messages_malformed_store.test_empty_eml_is_served_as_degenerate_message_after_restart", + "eval.tests.test_messages_malformed_store.test_empty_eml_poisons_list", + "eval.tests.test_messages_malformed_store.test_from_bare_address_without_name_panics_reset", + "eval.tests.test_messages_malformed_store.test_garbage_json_endpoint_served", + "eval.tests.test_messages_malformed_store.test_garbage_source_and_eml_roundtrip", + "eval.tests.test_messages_malformed_store.test_mixed_good_and_empty_store_poisons_once_empty_read", + "eval.tests.test_messages_malformed_store.test_no_from_header_serves_empty_sender", + "eval.tests.test_messages_no_text_panic.test_attachment_only_eml_still_served_exact_bytes", + "eval.tests.test_messages_no_text_panic.test_attachment_only_formats_is_source_only", + "eval.tests.test_messages_no_text_panic.test_attachment_only_html_panics_reset", + "eval.tests.test_messages_no_text_panic.test_attachment_only_json_deterministic_fields", + "eval.tests.test_messages_no_text_panic.test_attachment_only_list_serves_json", + "eval.tests.test_messages_no_text_panic.test_attachment_only_plain_panics_reset", + "eval.tests.test_messages_no_text_panic.test_attachment_only_source_still_served_exact_bytes", + "eval.tests.test_messages_no_text_panic.test_image_attachment_only_plain_html_reset", + "eval.tests.test_messages_no_text_panic.test_server_recovers_after_no_text_panics", + "eval.tests.test_messages_no_text_panic.test_text_attachment_only_still_lacks_plain_text_body", + "eval.tests.test_messages_sequence_lifecycle.test_delete_middle_then_deliver_keeps_gap", + "eval.tests.test_messages_sequence_lifecycle.test_deliver_then_delete_lowest_frees_id_but_not_renumbered", + "eval.tests.test_messages_sequence_lifecycle.test_deliveries_after_clear_increment_contiguously", + "eval.tests.test_messages_sequence_lifecycle.test_delivery_after_delete_all_restarts_sequence_above_old_max", + "eval.tests.test_messages_sequence_lifecycle.test_delivery_after_delete_takes_next_id_not_reused", + "eval.tests.test_messages_sequence_lifecycle.test_sequence_ids_present_in_disk_filenames", + "eval.tests.test_messages_sequence_lifecycle.test_sequence_survives_process_restart_from_on_disk_files", + "eval.tests.test_messages_smtp_attachment_edges.test_declared_content_id_header_is_ignored_for_cid", + "eval.tests.test_messages_smtp_attachment_edges.test_identical_deliveries_are_distinct_messages", + "eval.tests.test_messages_smtp_attachment_edges.test_inline_html_part_is_body_not_attachment", + "eval.tests.test_messages_smtp_attachment_edges.test_smtp_attachment_only_formats_source_only", + "eval.tests.test_messages_smtp_attachment_edges.test_smtp_attachment_only_plain_html_reset", + "eval.tests.test_messages_smtp_attachment_edges.test_smtp_attachment_only_source_and_eml_served", + "eval.tests.test_messages_smtp_attachment_edges.test_smtp_delivered_attachment_json_metadata_via_get", + "eval.tests.test_route_method_gate.test_head_served_on_get_routes", + "eval.tests.test_route_method_gate.test_root_route_accepts_get_only", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_eml]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_html]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_json]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_parts_x]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_plain]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_messages_1_source]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_version0]", + "eval.tests.test_route_method_gate.test_route_method_gate[DELETE__api_version1]", + "eval.tests.test_route_method_gate.test_route_method_gate[GET__api_messages]", + "eval.tests.test_route_method_gate.test_route_method_gate[GET__api_messages_1]", + "eval.tests.test_route_method_gate.test_route_method_gate[POST__api_messages]", + "eval.tests.test_route_method_gate.test_route_method_gate[POST__api_messages_1]", + "eval.tests.test_route_method_gate.test_route_method_gate[POST__api_messages_1_source]", + "eval.tests.test_route_method_gate.test_route_method_gate[POST__api_version]", + "eval.tests.test_route_method_gate.test_route_method_gate[PUT__api_messages_1]", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_html_endpoint", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_json_formats", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_message_id_increments_over_multiple_deliveries", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_multi_recipient_to_header_yields_empty", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_multipart_attachment_in_json", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_persists_across_list_and_get", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_plain_endpoint", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_single_recipient_parsed", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_source_exact_bytes", + "eval.tests.test_smtp_delivery_api.test_smtp_delivered_then_delete_removes_file", + "eval.tests.test_smtp_delivery_api.test_smtp_delivery_then_delete_all_empties_dir", + "eval.tests.test_static_assets.test_css_content_is_css", + "eval.tests.test_static_assets.test_index_html_content_is_html", + "eval.tests.test_static_assets.test_index_html_is_served_byte_stable_across_requests", + "eval.tests.test_static_assets.test_js_serves_javascript_content", + "eval.tests.test_static_assets.test_static_asset_status_and_content_type[css]", + "eval.tests.test_static_assets.test_static_asset_status_and_content_type[index]", + "eval.tests.test_static_assets.test_static_asset_status_and_content_type[js]", + "eval.tests.test_static_assets.test_static_asset_status_and_content_type[wasm]", + "eval.tests.test_static_assets.test_static_assets_served_with_messages_in_store", + "eval.tests.test_static_assets.test_wasm_serves_full_binary_module", + "eval.tests.test_version_api.test_api_version_trailing_path_is_404", + "eval.tests.test_version_api.test_version_body_is_exact_json_object", + "eval.tests.test_version_api.test_version_is_stable_across_calls", + "eval.tests.test_version_api.test_version_returns_200_and_json_content_type", + "eval.tests.test_version_api.test_version_value_is_exact_semver", + "eval.tests.test_version_api.test_version_with_messages_still_serves", + "eval.tests.test_version_api.test_version_works_when_no_messages_present", + "eval.tests.test_websocket.test_ws_like_but_unregistered_routes_do_not_upgrade[/api/ws]", + "eval.tests.test_websocket.test_ws_like_but_unregistered_routes_do_not_upgrade[/nope]", + "eval.tests.test_websocket.test_ws_like_but_unregistered_routes_do_not_upgrade[/ws/extra]", + "eval.tests.test_websocket.test_ws_plain_http_get_without_upgrade_headers", + "eval.tests.test_websocket.test_ws_response_contains_upgrade_header", + "eval.tests.test_websocket.test_ws_route_upgrades_101", + "eval.tests.test_websocket.test_ws_sec_websocket_accept_is_valid", + "eval.tests.test_websocket.test_ws_upgrade_when_messages_in_store", + "eval.tests.test_websocket_broadcast.test_ws_delivery_populates_maildir_storage", + "eval.tests.test_websocket_broadcast.test_ws_event_contains_full_message_fields", + "eval.tests.test_websocket_broadcast.test_ws_event_matches_http_list_content", + "eval.tests.test_websocket_broadcast.test_ws_no_event_before_any_delivery", + "eval.tests.test_websocket_broadcast.test_ws_receives_add_event_on_smtp_delivery", + "eval.tests.test_websocket_broadcast.test_ws_receives_event_for_multipart_delivery", + "eval.tests.test_websocket_broadcast.test_ws_receives_two_consecutive_broadcasts", + "eval.tests.test_websocket_multi_subscriber.test_third_subscriber_joining_late_sees_next_broadcast", + "eval.tests.test_websocket_multi_subscriber.test_two_deliveries_fan_out_to_two_subscribers_in_order", + "eval.tests.test_websocket_multi_subscriber.test_two_subscribers_both_receive_same_broadcast" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_config_args.test_no_args_binds_default_ports_then_serves", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_config_args.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_args.test_smtp_default_port_env_override", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_config_args.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_paths.test_get_missing_id_then_valid_still_works", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_error_paths.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_paths.test_get_source_missing_id", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_error_paths.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_paths.test_server_survives_missing_id_request", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_error_paths.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_memdir_depth.test_list_panics_on_stray_file_without_backing_eml", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_memdir_depth.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_memdir_depth.test_maildir_get_after_delete_all_connection_dropped", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_memdir_depth.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_memdir_edge.test_memory_delete_nonexistent_id_brings_down_http", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_memdir_edge.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_memdir_remove_and_sequence.test_maildir_remove_absent_id_panics_connection_drop", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_memdir_remove_and_sequence.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_memdir_remove_and_sequence.test_maildir_remove_present_then_get_drops_and_seq_continues", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_memdir_remove_and_sequence.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module_coverage_extra.test_maildir_get_of_evicted_id_drops_connection", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_module_coverage_extra.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_storage_model_round5.test_memory_delete_all_then_get_old_id_drops", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_storage_model_round5.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_capacity_limit.test_evict_then_read_remaining_source", + "eval.tests.test_capacity_limit.test_limit_eviction_does_not_affect_sequence_ids", + "eval.tests.test_capacity_limit.test_limit_one_keeps_only_newest", + "eval.tests.test_capacity_limit.test_maildir_eviction_leaves_inotify_friendly_files", + "eval.tests.test_capacity_limit.test_maildir_eviction_persists_across_restart", + "eval.tests.test_capacity_limit.test_maildir_evicts_oldest_files[1-4-files2]", + "eval.tests.test_capacity_limit.test_maildir_evicts_oldest_files[10-3-files3]", + "eval.tests.test_capacity_limit.test_maildir_evicts_oldest_files[2-6-files1]", + "eval.tests.test_capacity_limit.test_maildir_evicts_oldest_files[3-5-files0]", + "eval.tests.test_capacity_limit.test_memory_eviction_acks_sequence_keeps_counting", + "eval.tests.test_capacity_limit.test_memory_eviction_removes_lowest_ids", + "eval.tests.test_capacity_limit.test_memory_evicts_oldest_over_limit[1-4-expected2]", + "eval.tests.test_capacity_limit.test_memory_evicts_oldest_over_limit[10-5-expected3]", + "eval.tests.test_capacity_limit.test_memory_evicts_oldest_over_limit[2-6-expected1]", + "eval.tests.test_capacity_limit.test_memory_evicts_oldest_over_limit[3-5-expected0]", + "eval.tests.test_capacity_limit.test_memory_evicts_oldest_over_limit[5-5-expected4]", + "eval.tests.test_capacity_limit.test_memory_limit_greater_than_stored_keeps_all", + "eval.tests.test_config_args.test_env_var_port_config", + "eval.tests.test_config_args.test_help_documents_both_storage_values", + "eval.tests.test_config_args.test_help_flag_matches_golden[--help]", + "eval.tests.test_config_args.test_help_flag_matches_golden[-h]", + "eval.tests.test_config_args.test_invalid_storage_value_errors_with_golden", + "eval.tests.test_config_args.test_maildir_via_env", + "eval.tests.test_config_args.test_memory_is_default_storage", + "eval.tests.test_config_args.test_no_args_binds_default_ports_then_serves", + "eval.tests.test_config_args.test_smtp_default_port_env_override", + "eval.tests.test_config_args.test_storage_is_case_sensitive_enum", + "eval.tests.test_config_args.test_unknown_flag_errors_with_golden_stderr", + "eval.tests.test_config_args.test_version_flag_matches_golden[--version]", + "eval.tests.test_config_args.test_version_flag_matches_golden[-V]", + "eval.tests.test_config_args.test_version_reports_0_3_0", + "eval.tests.test_error_paths.test_empty_body_html_endpoint", + "eval.tests.test_error_paths.test_empty_body_message_stored_and_plain_empty", + "eval.tests.test_error_paths.test_from_without_angle_address_aborts[NoAngle alice@example.com-SMTPSenderRefused]", + "eval.tests.test_error_paths.test_from_without_angle_address_aborts[a.b-c@example.co.uk-SMTPServerDisconnected]", + "eval.tests.test_error_paths.test_get_missing_id_closes_connection[eml]", + "eval.tests.test_error_paths.test_get_missing_id_closes_connection[html]", + "eval.tests.test_error_paths.test_get_missing_id_closes_connection[json]", + "eval.tests.test_error_paths.test_get_missing_id_closes_connection[plain]", + "eval.tests.test_error_paths.test_get_missing_id_closes_connection[source]", + "eval.tests.test_error_paths.test_get_missing_id_then_valid_still_works", + "eval.tests.test_error_paths.test_get_source_missing_id", + "eval.tests.test_error_paths.test_server_survives_missing_id_request", + "eval.tests.test_error_paths.test_unnamed_sender_aborts_smtp_session", + "eval.tests.test_error_paths.test_unnamed_sender_not_stored", + "eval.tests.test_error_paths.test_whitespace_only_subject_preserved", + "eval.tests.test_http_api.test_api_404_for_unknown_route", + "eval.tests.test_http_api.test_attachment_download_correct_cid", + "eval.tests.test_http_api.test_attachment_download_with_bad_cid_is_empty", + "eval.tests.test_http_api.test_content_type_for_eml", + "eval.tests.test_http_api.test_content_type_for_html", + "eval.tests.test_http_api.test_content_type_for_plain", + "eval.tests.test_http_api.test_content_types_for_source", + "eval.tests.test_http_api.test_delete_all_returns_html_ok", + "eval.tests.test_http_api.test_delete_message_returns_200", + "eval.tests.test_http_api.test_list_json_content_type", + "eval.tests.test_http_api.test_multiple_ops_lifecycle", + "eval.tests.test_http_api.test_read_endpoints_then_clean[GET-/api/messages-]", + "eval.tests.test_http_api.test_read_endpoints_then_clean[GET-/api/version-]", + "eval.tests.test_http_api.test_version_endpoint_shape", + "eval.tests.test_maildir_storage.test_maildir_creates_one_eml_file_per_message[1]", + "eval.tests.test_maildir_storage.test_maildir_creates_one_eml_file_per_message[3]", + "eval.tests.test_maildir_storage.test_maildir_default_path_is_created", + "eval.tests.test_maildir_storage.test_maildir_delete_all_keeps_directory", + "eval.tests.test_maildir_storage.test_maildir_delete_removes_eml_file", + "eval.tests.test_maildir_storage.test_maildir_deleted_file_absent_from_restart_list", + "eval.tests.test_maildir_storage.test_maildir_eml_content_type_on_disk", + "eval.tests.test_maildir_storage.test_maildir_file_contains_raw_source", + "eval.tests.test_maildir_storage.test_maildir_files_named_by_id", + "eval.tests.test_maildir_storage.test_maildir_get_by_id", + "eval.tests.test_maildir_storage.test_maildir_list_after_delete_all_is_empty", + "eval.tests.test_maildir_storage.test_maildir_list_from_disk_matches_added", + "eval.tests.test_maildir_storage.test_maildir_multiple_restarts_keep_incrementing", + "eval.tests.test_maildir_storage.test_maildir_restart_retains_existing_messages", + "eval.tests.test_maildir_storage.test_maildir_sequence_continues_after_restart", + "eval.tests.test_maildir_storage.test_maildir_source_readback_matches_written", + "eval.tests.test_maildir_storage.test_maildir_stop_and_data_persists_on_disk", + "eval.tests.test_memdir_depth.test_cold_start_get_of_preseeded_id", + "eval.tests.test_memdir_depth.test_cold_start_lists_all_preseeded_messages", + "eval.tests.test_memdir_depth.test_cold_start_sequence_above_all_seeded", + "eval.tests.test_memdir_depth.test_cold_start_sequence_is_max_plus_one", + "eval.tests.test_memdir_depth.test_delete_all_leaves_only_non_eml_strays", + "eval.tests.test_memdir_depth.test_delete_all_removes_only_eml_files", + "eval.tests.test_memdir_depth.test_get_reads_from_disk_not_cache", + "eval.tests.test_memdir_depth.test_list_panics_on_stray_file_without_backing_eml", + "eval.tests.test_memdir_depth.test_maildir_cold_start_empty_then_add_starts_at_one", + "eval.tests.test_memdir_depth.test_maildir_eviction_respects_seeded_count", + "eval.tests.test_memdir_depth.test_maildir_get_after_delete_all_connection_dropped", + "eval.tests.test_memdir_depth.test_maildir_noncontiguous_seed_next_new", + "eval.tests.test_memdir_depth.test_maildir_path_is_regular_file_panics[a.eml.bak]", + "eval.tests.test_memdir_depth.test_maildir_path_is_regular_file_panics[plain]", + "eval.tests.test_memdir_depth.test_maildir_path_is_regular_file_panics[sub/dir]", + "eval.tests.test_memdir_depth.test_maildir_write_only_writes_when_data_end", + "eval.tests.test_memdir_edge.test_find_last_sequence_counts_non_eml_file", + "eval.tests.test_memdir_edge.test_find_last_sequence_counts_numeric_subdir", + "eval.tests.test_memdir_edge.test_maildir_cold_start_over_limit_evicts_highest_seeded", + "eval.tests.test_memdir_edge.test_maildir_limit_zero_evicts_immediately", + "eval.tests.test_memdir_edge.test_memory_delete_nonexistent_id_brings_down_http", + "eval.tests.test_memdir_edge.test_non_numeric_eml_stem_panics_at_startup", + "eval.tests.test_memdir_edge.test_stray_file_inflates_size_and_eviction_panics", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_capacity_keeps_newest_over_batch_adds", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_delete_all_returns_ok_and_sequence_continues", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_evicts_when_size_strictly_exceeds_limit_boundary", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_remove_absent_id_panics_connection_drop", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_remove_present_then_get_drops_and_seq_continues", + "eval.tests.test_memdir_remove_and_sequence.test_maildir_zero_stem_seed_next_id_is_one", + "eval.tests.test_memdir_remove_and_sequence.test_memory_delete_all_ok_and_sequence_continues", + "eval.tests.test_memdir_remove_and_sequence.test_memory_remove_present_id_clears_exactly_that_record", + "eval.tests.test_memory_storage.test_bodies_do_not_leak_source_into_list", + "eval.tests.test_memory_storage.test_delete_all_empties_store", + "eval.tests.test_memory_storage.test_delete_all_then_add_again[1]", + "eval.tests.test_memory_storage.test_delete_all_then_add_again[3]", + "eval.tests.test_memory_storage.test_empty_list_before_any_add", + "eval.tests.test_memory_storage.test_full_json_shape", + "eval.tests.test_memory_storage.test_get_by_id_returns_stored_message[1]", + "eval.tests.test_memory_storage.test_get_by_id_returns_stored_message[5]", + "eval.tests.test_memory_storage.test_get_source_by_id", + "eval.tests.test_memory_storage.test_insertion_order_of_single_add", + "eval.tests.test_memory_storage.test_list_is_plain_json_array", + "eval.tests.test_memory_storage.test_memory_list_reflects_all_added", + "eval.tests.test_memory_storage.test_remove_deletes_single_by_id", + "eval.tests.test_memory_storage.test_remove_then_ids_not_reused", + "eval.tests.test_memory_storage.test_sequence_ids_start_at_one_and_increment[10]", + "eval.tests.test_memory_storage.test_sequence_ids_start_at_one_and_increment[1]", + "eval.tests.test_memory_storage.test_sequence_ids_start_at_one_and_increment[3]", + "eval.tests.test_message_model.test_attachment_body_downloaded_by_cid_octet_stream", + "eval.tests.test_message_model.test_attachment_metadata_and_download[application/octet-stream-data.bin-some text note]", + "eval.tests.test_message_model.test_attachment_metadata_and_download[application/pdf-report.pdf-%PDF-1.4 fake]", + "eval.tests.test_message_model.test_attachment_metadata_and_download[image/png-img.png-PNGDATAFAKE]", + "eval.tests.test_message_model.test_attachment_type_is_primary_mime_type[application/octet-stream-application]", + "eval.tests.test_message_model.test_attachment_type_is_primary_mime_type[application/pdf-application]", + "eval.tests.test_message_model.test_attachment_type_is_primary_mime_type[message/rfc822-message]", + "eval.tests.test_message_model.test_created_at_timestamp_format", + "eval.tests.test_message_model.test_eml_endpoint_equals_source", + "eval.tests.test_message_model.test_formats_html_and_plain_present", + "eval.tests.test_message_model.test_formats_include_source[Content-Type: text/plain\\r\\n]", + "eval.tests.test_message_model.test_formats_include_source[]", + "eval.tests.test_message_model.test_id_field_assigned_by_storage", + "eval.tests.test_message_model.test_inline_body_without_content_type_is_not_attachment", + "eval.tests.test_message_model.test_json_excludes_source_body_fields", + "eval.tests.test_message_model.test_multipart_html_parsing", + "eval.tests.test_message_model.test_multipart_plain_parsing", + "eval.tests.test_message_model.test_multiple_attachments_listed", + "eval.tests.test_message_model.test_plain_and_html_endpoints_reachable[only-html]", + "eval.tests.test_message_model.test_plain_and_html_endpoints_reachable[only-plain]", + "eval.tests.test_message_model.test_plain_endpoint_echoes_body[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]", + "eval.tests.test_message_model.test_plain_endpoint_echoes_body[b]", + "eval.tests.test_message_model.test_plain_endpoint_echoes_body[multi\\nline\\nbody\\ntext]", + "eval.tests.test_message_model.test_plain_endpoint_echoes_body[unicode: caf\\xe9 \\u20ac39]", + "eval.tests.test_message_model.test_plain_endpoint_returns_body_text", + "eval.tests.test_message_model.test_recipients_empty_for_comma_list", + "eval.tests.test_message_model.test_recipients_empty_when_no_to_header", + "eval.tests.test_message_model.test_recipients_single_address[Bob Smith -expected1]", + "eval.tests.test_message_model.test_recipients_single_address[bob@example.com-expected0]", + "eval.tests.test_message_model.test_sender_name_address_concat[\"Alice Smith\" -Alice Smith alice@example.com]", + "eval.tests.test_message_model.test_sender_name_address_concat[A.B-C -A.B-C a.b-c@example.co.uk]", + "eval.tests.test_message_model.test_sender_name_address_concat[Alice -Alice alice@example.com]", + "eval.tests.test_message_model.test_sender_name_address_concat[Bob -Bob bob@example.com]", + "eval.tests.test_message_model.test_source_endpoint_returns_raw_source", + "eval.tests.test_message_model.test_subject_stored_verbatim[-]", + "eval.tests.test_message_model.test_subject_stored_verbatim[Hello World-Hello World]", + "eval.tests.test_message_model.test_subject_stored_verbatim[MIME-Version,is,not,subject-MIME-Version,is,not,subject]", + "eval.tests.test_message_model.test_subject_stored_verbatim[Re: Fwd: deep thread-Re: Fwd: deep thread]", + "eval.tests.test_message_model.test_subject_stored_verbatim[Subject with = sign-Subject with = sign]", + "eval.tests.test_message_model.test_unknown_attachment_name_defaults", + "eval.tests.test_message_model.test_whitespace_only_subject_is_stored_empty[ ]", + "eval.tests.test_message_model.test_whitespace_only_subject_is_stored_empty[ \\t ]", + "eval.tests.test_message_model.test_whitespace_only_subject_is_stored_empty[\\t\\t]", + "eval.tests.test_module_coverage_extra.test_base64_plain_body_decoded", + "eval.tests.test_module_coverage_extra.test_comma_list_to_yields_no_recipients[one@x.z, two@y.z, three@z.q]", + "eval.tests.test_module_coverage_extra.test_comma_list_to_yields_no_recipients[one@x.z, two@y.z]", + "eval.tests.test_module_coverage_extra.test_empty_and_whitespace_subject_stored_empty[ ]", + "eval.tests.test_module_coverage_extra.test_empty_and_whitespace_subject_stored_empty[\\t]", + "eval.tests.test_module_coverage_extra.test_empty_and_whitespace_subject_stored_empty[]", + "eval.tests.test_module_coverage_extra.test_html_only_body_exposes_both_html_and_plain", + "eval.tests.test_module_coverage_extra.test_maildir_get_of_evicted_id_drops_connection", + "eval.tests.test_module_coverage_extra.test_maildir_limit_one_keeps_only_newest_file", + "eval.tests.test_module_coverage_extra.test_maildir_sequence_after_seed_then_evict", + "eval.tests.test_module_coverage_extra.test_memory_limit_exact_after_eviction_sequence", + "eval.tests.test_module_coverage_extra.test_messages_limit_zero_keeps_nothing", + "eval.tests.test_module_coverage_extra.test_missing_from_header_stores_empty_sender", + "eval.tests.test_module_coverage_extra.test_multipart_alternative_plain_and_html_exact", + "eval.tests.test_module_coverage_extra.test_multipart_with_body_then_binary_attachment", + "eval.tests.test_module_coverage_extra.test_plain_endpoint_content_type_has_charset", + "eval.tests.test_module_coverage_extra.test_quoted_printable_plain_body_decoded", + "eval.tests.test_module_coverage_extra.test_quoted_sender_display_name_preserved", + "eval.tests.test_module_coverage_extra.test_rfc2047_encoded_subject_decoded[=?UTF-8?B?aGVsbG8gc3ViamVjdA==?=-hello subject]", + "eval.tests.test_module_coverage_extra.test_rfc2047_encoded_subject_decoded[=?UTF-8?Q?caf=C3=A9_latte?=-caf\\xe9 latte]", + "eval.tests.test_module_coverage_extra.test_rfc2047_encoded_subject_decoded[Total = 42 units-Total = 42 units]", + "eval.tests.test_module_coverage_extra.test_second_same_type_text_part_is_attachment", + "eval.tests.test_module_coverage_extra.test_unnamed_sender_address_drops_connection_memory", + "eval.tests.test_storage_model_round5.test_maildir_list_multiple_distinct_messages", + "eval.tests.test_storage_model_round5.test_maildir_nonexistent_path_created_on_start", + "eval.tests.test_storage_model_round5.test_memory_delete_all_then_get_old_id_drops", + "eval.tests.test_storage_model_round5.test_memory_limit_no_eviction_until_strictly_exceeded", + "eval.tests.test_storage_model_round5.test_memory_list_shrinks_after_remove", + "eval.tests.test_storage_model_round5.test_message_json_never_serializes_source_bytes", + "eval.tests.test_storage_model_round5.test_message_without_recipients_has_empty_recipients", + "eval.tests.test_storage_model_round5.test_seeded_maildir_get_source_round_trips_exact", + "eval.tests.test_storage_model_round5.test_stored_message_json_exposes_exact_fields" + ] + } + }, + "commit": "661a6be4e1c51cb3d9f750f78ab347ec127122da", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.1763806922432702, + "eval_clean_hashes": [ + "3cbdf15a87706b4881a59f0005c331d7af3161ada701caad9a1e359caa4c9400" + ], + "input_record": { + "codeql_db_mb": 84.03, + "codeql_status": true, + "codeql_time": 43.81528593786061, + "commit": "661a6be4e1c51cb3d9f750f78ab347ec127122da", + "commits": 195, + "contributors": 5, + "difficulty": "easy", + "difficulty_code_lines": 1501, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1501, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.1763806922432702, + "difficulty_test_code_lines": 0, + "full_name": "mailtutan/mailtutan", + "github_stars": 204, + "input_codeql_db": "rust_codeql/mailtutan__mailtutan", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "ogham/dog", + "rank": 671, + "similarity": 0.4163269102573395 + }, + { + "pb_fullname": "quinn-rs/quinn", + "rank": 741, + "similarity": 0.43950802087783813 + } + ], + "repo_age": 3.23, + "repo_path": "rust/mailtutan__mailtutan", + "rust_channel": "stable", + "rust_edition": "2021", + "rust_release_date": "2021-10-21", + "rust_version": "1.56.0", + "rust_version_source": "edition", + "source": "commit:661a6be4e1c51cb3d9f750f78ab347ec127122da", + "status": "done", + "url": "https://github.com/mailtutan/mailtutan" + }, + "instance_id": "mailtutan__mailtutan.661a6be", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "mailtutan/mailtutan" +} diff --git a/mailtutan--mailtutan.661a6be/tests/test.sh b/mailtutan--mailtutan.661a6be/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mailtutan--mailtutan.661a6be/tests/workspace.tar.gz b/mailtutan--mailtutan.661a6be/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c144e3a78de4b76c074ba2f8bdd1d0efce200028 --- /dev/null +++ b/mailtutan--mailtutan.661a6be/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de7ffc33de01620ee6e643f716764de9fe64fe9dca551cbc8c416357ededb1c1 +size 263361 diff --git a/mainmatter--cargo-autoinherit.0b/environment/Dockerfile b/mainmatter--cargo-autoinherit.0b/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mainmatter--cargo-autoinherit.0b/environment/download.sh b/mainmatter--cargo-autoinherit.0b/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a843a37e92bf64b14b224ecece90a24bb032b280 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/environment/download.sh @@ -0,0 +1,754 @@ +#!/usr/bin/env bash +# +# download.sh — ProgramGym networked dependency-prefetch stage for +# mainmatter/cargo-autoinherit (a Cargo subcommand binary). +# +# This file is intended to be *sourced* (not executed) from the repository root: +# source /source_ro/download.sh +# +# It must be standalone: it must NOT read any repository file. All dependency +# information (Cargo manifest + pinned Cargo.lock) is embedded inline below. It +# only populates the offline cargo registry cache; it does not build or test +# anything. +# +# No `exit` in normal control flow (source-safe). Failures are surfaced by the +# `set -e`-style guard implemented via an explicit branch. + +set -eu + +# Guard: download.sh must be sourced, never executed. When sourced, +# ${BASH_SOURCE[0]} (this file) differs from $0 (the parent shell); when +# executed directly they are equal and we abort. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source ./download.sh" >&2 + exit 2 +fi + +# --------------------------------------------------------------------------- +# Working area for the generated (temporary) Cargo project. +# --------------------------------------------------------------------------- +FETCH_WORKDIR="$(mktemp -d)" +mkdir -p "$FETCH_WORKDIR/src" + +# Cargo home: default ~/.cargo is fine in the download stage. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" + +# --------------------------------------------------------------------------- +# 1. Write the generated Cargo manifest (mirrors the repository's direct +# dependencies exactly). +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/Cargo.toml" <<'TOML' +[package] +name = "cargo-autoinherit" +version = "0.1.6" +edition = "2021" + +[dependencies] +anyhow = "1.0.80" +clap = { version = "4", features = ["derive"] } +guppy = "0.17.5" +fs-err = "2.11.0" +cargo-manifest = "0.19.1" +toml = "0.8.10" +semver = "1.0.22" +toml_edit = "0.22.6" +pathdiff = "0.2.1" +TOML + +# --------------------------------------------------------------------------- +# 2. Write stub source files so the generated manifest resolves cleanly under +# `cargo fetch` (convention-based lib + bin targets). +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/src/lib.rs" <<'EOF' +// Stub generated by download.sh purely so `cargo fetch` can resolve the +// generated manifest; download.sh performs no compilation. +EOF + +cat > "$FETCH_WORKDIR/src/main.rs" <<'EOF' +fn main() {} +EOF + +# --------------------------------------------------------------------------- +# 3. Write the pinned Cargo.lock inline so the versions fetched exactly match +# the ones the offline build resolves from the repository's real lockfile. +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/Cargo.lock" <<'LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-autoinherit" +version = "0.1.6" +dependencies = [ + "anyhow", + "cargo-manifest", + "clap", + "fs-err", + "guppy", + "pathdiff", + "semver", + "toml", + "toml_edit", +] + +[[package]] +name = "cargo-manifest" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d8af896b707212cd0e99c112a78c9497dd32994192a463ed2f7419d29bd8c6" +dependencies = [ + "serde", + "thiserror 2.0.11", + "toml", +] + +[[package]] +name = "cargo-platform" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.58", +] + +[[package]] +name = "cfg-expr" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "debug-ignore" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guppy" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34e99a7734579b834a076ef11789783c153c6eb5fb3520ed15bc41f483f0f317" +dependencies = [ + "ahash", + "camino", + "cargo_metadata", + "cfg-if", + "debug-ignore", + "fixedbitset", + "guppy-workspace-hack", + "indexmap", + "itertools", + "nested", + "once_cell", + "pathdiff", + "petgraph", + "semver", + "serde", + "serde_json", + "smallvec", + "static_assertions", + "target-spec", +] + +[[package]] +name = "guppy-workspace-hack" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92620684d99f750bae383ecb3be3748142d6095760afd5cbcf2261e9a279d780" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "indexmap" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "nested" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b420f638f07fe83056b55ea190bb815f609ec5a35e7017884a10f78839c9e" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +dependencies = [ + "camino", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "target-spec" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a8e795b1824524d13cdf04f73cf8b4f244ce86c96b4d2a83a6ca1a753d2752" +dependencies = [ + "cfg-expr", + "guppy-workspace-hack", + "target-lexicon", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +dependencies = [ + "thiserror-impl 1.0.58", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] +LOCK + +# --------------------------------------------------------------------------- +# 4. Prefetch every dependency declared by the generated manifest into the +# offline cargo registry cache. `--locked` guarantees the versions cached are +# exactly the ones pinned above (and pinned by the repository's real lock). +# Running from a mktemp dir with `--manifest-path` avoids the repo root and +# does not read any repository file. +# --------------------------------------------------------------------------- +cargo fetch --locked --manifest-path "$FETCH_WORKDIR/Cargo.toml" + +echo "download.sh: cargo dependency prefetch complete." diff --git a/mainmatter--cargo-autoinherit.0b/environment/executable b/mainmatter--cargo-autoinherit.0b/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..1622c16ad91679a740d70a052450e34119abb900 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1324aea7c4daa530ef27ecfe229eb82f6053a7ff93b33500c1500ea3bca061 +size 3578920 diff --git a/mainmatter--cargo-autoinherit.0b/environment/harbor_prepare_download_env.sh b/mainmatter--cargo-autoinherit.0b/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mainmatter--cargo-autoinherit.0b/environment/workspace.tar.gz b/mainmatter--cargo-autoinherit.0b/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d23bae3dcaa4db626bd29c3687040b893fa490ca --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:939d482dd2d8ab03b16dee333b0f46110dcca8b7d5da9076e1249d3e2f4c60a8 +size 6483 diff --git a/mainmatter--cargo-autoinherit.0b/instruction.md b/mainmatter--cargo-autoinherit.0b/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mainmatter--cargo-autoinherit.0b/solution/solve.sh b/mainmatter--cargo-autoinherit.0b/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mainmatter--cargo-autoinherit.0b/task.toml b/mainmatter--cargo-autoinherit.0b/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..890574d8b944bd555e4448706ecd8214b054d2ea --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mainmatter--cargo-autoinherit.0b" +description = "Synthetic ProgramGym cleanroom reconstruction task for mainmatter/cargo-autoinherit" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "mainmatter__cargo-autoinherit.0bb5bee" +repository = "mainmatter/cargo-autoinherit" +commit = "0bb5bee3fad1c0623cac1ca8dfeebc539099f75e" +language = "rust" +difficulty = "easy" +difficulty_score = 1.9283958522567137 +test_branches = 3 +test_count = 198 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mainmatter--cargo-autoinherit.0b/tests/Dockerfile b/mainmatter--cargo-autoinherit.0b/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_01.tar.gz b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e2a3732f489fa74ea33cbb711591e6505812310 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84233d577fd0685d2d6cf87f9b2a0fb128722a80a88160dfb708eb4cc22facc6 +size 18220 diff --git a/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_02.tar.gz b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..dbb85d4018ac3bbd7fc112c9ecc05d075e964df9 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:588561b2dbaa9c7129d660a556193bcda302d0b65eccbf610843d9f13c0ee969 +size 20179 diff --git a/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_03.tar.gz b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0ad98f6b26663827a1d8bc4deff4f524d30231c1 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f92c91bf97eed3b1eb61df8be262f7abff2060705e0c5432ca93a08c4b05ab5 +size 14435 diff --git a/mainmatter--cargo-autoinherit.0b/tests/download.sh b/mainmatter--cargo-autoinherit.0b/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a843a37e92bf64b14b224ecece90a24bb032b280 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/download.sh @@ -0,0 +1,754 @@ +#!/usr/bin/env bash +# +# download.sh — ProgramGym networked dependency-prefetch stage for +# mainmatter/cargo-autoinherit (a Cargo subcommand binary). +# +# This file is intended to be *sourced* (not executed) from the repository root: +# source /source_ro/download.sh +# +# It must be standalone: it must NOT read any repository file. All dependency +# information (Cargo manifest + pinned Cargo.lock) is embedded inline below. It +# only populates the offline cargo registry cache; it does not build or test +# anything. +# +# No `exit` in normal control flow (source-safe). Failures are surfaced by the +# `set -e`-style guard implemented via an explicit branch. + +set -eu + +# Guard: download.sh must be sourced, never executed. When sourced, +# ${BASH_SOURCE[0]} (this file) differs from $0 (the parent shell); when +# executed directly they are equal and we abort. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + echo "download.sh must be sourced, not executed: source ./download.sh" >&2 + exit 2 +fi + +# --------------------------------------------------------------------------- +# Working area for the generated (temporary) Cargo project. +# --------------------------------------------------------------------------- +FETCH_WORKDIR="$(mktemp -d)" +mkdir -p "$FETCH_WORKDIR/src" + +# Cargo home: default ~/.cargo is fine in the download stage. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" + +# --------------------------------------------------------------------------- +# 1. Write the generated Cargo manifest (mirrors the repository's direct +# dependencies exactly). +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/Cargo.toml" <<'TOML' +[package] +name = "cargo-autoinherit" +version = "0.1.6" +edition = "2021" + +[dependencies] +anyhow = "1.0.80" +clap = { version = "4", features = ["derive"] } +guppy = "0.17.5" +fs-err = "2.11.0" +cargo-manifest = "0.19.1" +toml = "0.8.10" +semver = "1.0.22" +toml_edit = "0.22.6" +pathdiff = "0.2.1" +TOML + +# --------------------------------------------------------------------------- +# 2. Write stub source files so the generated manifest resolves cleanly under +# `cargo fetch` (convention-based lib + bin targets). +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/src/lib.rs" <<'EOF' +// Stub generated by download.sh purely so `cargo fetch` can resolve the +// generated manifest; download.sh performs no compilation. +EOF + +cat > "$FETCH_WORKDIR/src/main.rs" <<'EOF' +fn main() {} +EOF + +# --------------------------------------------------------------------------- +# 3. Write the pinned Cargo.lock inline so the versions fetched exactly match +# the ones the offline build resolves from the repository's real lockfile. +# --------------------------------------------------------------------------- +cat > "$FETCH_WORKDIR/Cargo.lock" <<'LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-autoinherit" +version = "0.1.6" +dependencies = [ + "anyhow", + "cargo-manifest", + "clap", + "fs-err", + "guppy", + "pathdiff", + "semver", + "toml", + "toml_edit", +] + +[[package]] +name = "cargo-manifest" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d8af896b707212cd0e99c112a78c9497dd32994192a463ed2f7419d29bd8c6" +dependencies = [ + "serde", + "thiserror 2.0.11", + "toml", +] + +[[package]] +name = "cargo-platform" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.58", +] + +[[package]] +name = "cfg-expr" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "debug-ignore" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guppy" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34e99a7734579b834a076ef11789783c153c6eb5fb3520ed15bc41f483f0f317" +dependencies = [ + "ahash", + "camino", + "cargo_metadata", + "cfg-if", + "debug-ignore", + "fixedbitset", + "guppy-workspace-hack", + "indexmap", + "itertools", + "nested", + "once_cell", + "pathdiff", + "petgraph", + "semver", + "serde", + "serde_json", + "smallvec", + "static_assertions", + "target-spec", +] + +[[package]] +name = "guppy-workspace-hack" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92620684d99f750bae383ecb3be3748142d6095760afd5cbcf2261e9a279d780" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "indexmap" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "nested" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b420f638f07fe83056b55ea190bb815f609ec5a35e7017884a10f78839c9e" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +dependencies = [ + "camino", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "target-spec" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a8e795b1824524d13cdf04f73cf8b4f244ce86c96b4d2a83a6ca1a753d2752" +dependencies = [ + "cfg-expr", + "guppy-workspace-hack", + "target-lexicon", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +dependencies = [ + "thiserror-impl 1.0.58", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] +LOCK + +# --------------------------------------------------------------------------- +# 4. Prefetch every dependency declared by the generated manifest into the +# offline cargo registry cache. `--locked` guarantees the versions cached are +# exactly the ones pinned above (and pinned by the repository's real lock). +# Running from a mktemp dir with `--manifest-path` avoids the repo root and +# does not read any repository file. +# --------------------------------------------------------------------------- +cargo fetch --locked --manifest-path "$FETCH_WORKDIR/Cargo.toml" + +echo "download.sh: cargo dependency prefetch complete." diff --git a/mainmatter--cargo-autoinherit.0b/tests/executable b/mainmatter--cargo-autoinherit.0b/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..1622c16ad91679a740d70a052450e34119abb900 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1324aea7c4daa530ef27ecfe229eb82f6053a7ff93b33500c1500ea3bca061 +size 3578920 diff --git a/mainmatter--cargo-autoinherit.0b/tests/harbor_prepare_download_env.sh b/mainmatter--cargo-autoinherit.0b/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mainmatter--cargo-autoinherit.0b/tests/programgym_evaluator.py b/mainmatter--cargo-autoinherit.0b/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mainmatter--cargo-autoinherit.0b/tests/programgym_task.json b/mainmatter--cargo-autoinherit.0b/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..d7407caad4892e4d3310872840e3285d8067b3aa --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/programgym_task.json @@ -0,0 +1,1817 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_autoinherit_basic.test_dispatch_rewrites_both_normal_and_inherited", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_basic.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_empty_workspace_no_member_deps_is_noop_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_member_already_inherited_is_byte_identical_noop", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_multiple_members_share_one_workspace_dep_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_retains_existing_workspace_dependencies_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_running_twice_is_idempotent_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_single_member_normalized_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_success_dispatch_exit_zero_and_stdout_stderr_empty", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_basic.test_version_caret_stripped_in_workspace_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_all_dep_kinds_combined_in_one_member_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_build_dependencies_promoted_to_workspace_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_compatible_caret_requirements_merge_to_max_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_default_dotted_form_is_inline_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_deps.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_default_features_disabled_preserved_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_default_features_equal_across_members_shared_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_default_features_mismatch_merges_to_false_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_dev_and_build_deps_across_members_merge_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_dev_dependencies_promoted_to_workspace_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_multiple_features_preserved_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_optional_dep_keeps_optional_true_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_optional_only_dep_keeps_optional_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_path_dependency_shared_as_relative_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_prefer_simple_dotted_keeps_inline_when_features_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_prefer_simple_dotted_plain_dep_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_deps.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_deps.test_underscore_dev_dependencies_table_kept", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_build_dependencies_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_dev_dependencies_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_underscore_build_dependencies_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_underscore_dev_dependencies_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit --prefer-simple-dotted timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_member_mixes_inherited_and_fresh_dep_exact", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_path_dep_with_default_features_false_kept_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_path_dep_with_version_kept_in_workspace_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_edge_cases.test_preexisting_workspace_dep_member_rewritten_to_inherit_exact", + "reasons": [ + { + "detail": "Failed: invocation autoinherit timed out after 120s: stdout=None stderr=None", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_exclude.test_exclude_combined_with_prefer_simple_dotted_exact", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_exclude.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_skips.test_incompatible_requirements_warn_and_skip_exact", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_skips.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_autoinherit_skips.test_multiple_sources_version_and_path_diagnostic_exact", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_autoinherit_skips.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_autoinherit_skips.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_help.test_help_describes_prefer_simple_dotted_exact", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_help.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dispatch_errors.test_error_return_code_is_one_for_engine_failures", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dispatch_errors.test_invalid_toml_member_manifest_fails", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dispatch_errors.test_nested_empty_dir_errors", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dispatch_errors.test_outside_cargo_project_errors", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_dispatch_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module01_dispatch_extra.test_dotted_mixed_deps_inline_and_dotted", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module01_dispatch_extra.test_dotted_plain_dep_default_and_flag_differ", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module01_dispatch_extra.test_dotted_plain_dep_uses_dotted_form", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module01_dispatch_extra.test_engine_error_prefix_and_caused_by", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_module01_dispatch_extra.test_exclude_combined_with_prefer_simple_dotted", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_module01_dispatch_extra.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_autoinherit_basic.test_dispatch_rewrites_both_normal_and_inherited", + "eval.tests.test_autoinherit_basic.test_empty_workspace_no_member_deps_is_noop_exact", + "eval.tests.test_autoinherit_basic.test_member_already_inherited_is_byte_identical_noop", + "eval.tests.test_autoinherit_basic.test_multiple_members_share_one_workspace_dep_exact", + "eval.tests.test_autoinherit_basic.test_retains_existing_workspace_dependencies_exact", + "eval.tests.test_autoinherit_basic.test_running_twice_is_idempotent_exact", + "eval.tests.test_autoinherit_basic.test_single_member_normalized_exact", + "eval.tests.test_autoinherit_basic.test_success_dispatch_exit_zero_and_stdout_stderr_empty", + "eval.tests.test_autoinherit_basic.test_version_caret_stripped_in_workspace_exact", + "eval.tests.test_autoinherit_deps.test_all_dep_kinds_combined_in_one_member_exact", + "eval.tests.test_autoinherit_deps.test_build_dependencies_promoted_to_workspace_exact", + "eval.tests.test_autoinherit_deps.test_compatible_caret_requirements_merge_to_max_exact", + "eval.tests.test_autoinherit_deps.test_default_dotted_form_is_inline_exact", + "eval.tests.test_autoinherit_deps.test_default_features_disabled_preserved_exact", + "eval.tests.test_autoinherit_deps.test_default_features_equal_across_members_shared_exact", + "eval.tests.test_autoinherit_deps.test_default_features_mismatch_merges_to_false_exact", + "eval.tests.test_autoinherit_deps.test_dev_and_build_deps_across_members_merge_exact", + "eval.tests.test_autoinherit_deps.test_dev_dependencies_promoted_to_workspace_exact", + "eval.tests.test_autoinherit_deps.test_identical_requirements_dedup_exact", + "eval.tests.test_autoinherit_deps.test_multiple_features_preserved_exact", + "eval.tests.test_autoinherit_deps.test_optional_dep_keeps_optional_true_exact", + "eval.tests.test_autoinherit_deps.test_optional_only_dep_keeps_optional_exact", + "eval.tests.test_autoinherit_deps.test_path_dependency_shared_as_relative_exact", + "eval.tests.test_autoinherit_deps.test_prefer_simple_dotted_keeps_inline_when_features_exact", + "eval.tests.test_autoinherit_deps.test_prefer_simple_dotted_plain_dep_exact", + "eval.tests.test_autoinherit_deps.test_underscore_dev_dependencies_table_kept", + "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_build_dependencies_exact", + "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_dev_dependencies_exact", + "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_underscore_build_dependencies_exact", + "eval.tests.test_autoinherit_edge_cases.test_dotted_form_in_underscore_dev_dependencies_exact", + "eval.tests.test_autoinherit_edge_cases.test_dotted_form_not_used_in_dev_for_featureful_dep_exact", + "eval.tests.test_autoinherit_edge_cases.test_excluded_member_unique_dep_not_promoted_exact", + "eval.tests.test_autoinherit_edge_cases.test_member_mixes_inherited_and_fresh_dep_exact", + "eval.tests.test_autoinherit_edge_cases.test_path_dep_with_default_features_false_kept_exact", + "eval.tests.test_autoinherit_edge_cases.test_path_dep_with_version_kept_in_workspace_exact", + "eval.tests.test_autoinherit_edge_cases.test_preexisting_workspace_dep_member_rewritten_to_inherit_exact", + "eval.tests.test_autoinherit_edge_cases.test_renamed_package_default_features_disagreement_merges_exact", + "eval.tests.test_autoinherit_edge_cases.test_same_dep_in_normal_and_dev_sections_single_ws_entry_exact", + "eval.tests.test_autoinherit_exclude.test_cli_and_metadata_exclusions_union_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_all_members_leaves_workspace_deps_absent_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_combined_with_prefer_simple_dotted_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_equals_and_long_flag_equivalent_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_members_repeatable_all_excluded_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_nonexistent_member_is_effective_noop_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_via_metadata_exact", + "eval.tests.test_autoinherit_exclude.test_exclude_via_metadata_underscore_variant_exact", + "eval.tests.test_autoinherit_exclude.test_excluded_member_dep_not_promoted_reported_exact", + "eval.tests.test_autoinherit_exclude.test_excluded_member_dep_not_promoted_when_only_in_excluded_exact", + "eval.tests.test_autoinherit_skips.test_compatible_requirements_still_inherited_exact", + "eval.tests.test_autoinherit_skips.test_incompatible_requirements_warn_and_skip_exact", + "eval.tests.test_autoinherit_skips.test_multiple_sources_version_and_path_diagnostic_exact", + "eval.tests.test_autoinherit_skips.test_pre_existing_inherited_dep_not_reprocessed_exact", + "eval.tests.test_autoinherit_skips.test_wildcard_and_pinned_merge_exact", + "eval.tests.test_cli_errors.test_error_exit_code_is_two_across_bad_inputs_exact", + "eval.tests.test_cli_errors.test_exclude_members_long_missing_value_exact", + "eval.tests.test_cli_errors.test_exclude_members_missing_value_exact", + "eval.tests.test_cli_errors.test_no_arguments_usage_error_exact", + "eval.tests.test_cli_errors.test_unknown_flag_does_not_create_manifest_exact", + "eval.tests.test_cli_errors.test_unknown_flag_on_autoinherit_exact", + "eval.tests.test_cli_errors.test_unknown_short_flag_exact", + "eval.tests.test_cli_errors.test_unknown_subcommand_exact", + "eval.tests.test_cli_errors.test_unknown_subcommand_second_exact", + "eval.tests.test_cli_help.test_autoinherit_option_mentions_exclude_members_exact", + "eval.tests.test_cli_help.test_exclude_members_long_missing_value_exact", + "eval.tests.test_cli_help.test_exclude_members_missing_value_exact", + "eval.tests.test_cli_help.test_help_describes_prefer_simple_dotted_exact", + "eval.tests.test_cli_help.test_help_exits_zero_and_short_circuits_engine_exact", + "eval.tests.test_cli_help.test_help_helper_subcommand_autoinherit_exact", + "eval.tests.test_cli_help.test_help_helper_subcommand_exact", + "eval.tests.test_cli_help.test_help_output_has_no_panic_noise_exact", + "eval.tests.test_cli_help.test_subcommand_help_exact_two_dashed_options", + "eval.tests.test_cli_help.test_subcommand_help_long_flag_exact", + "eval.tests.test_cli_help.test_subcommand_help_short_flag_exact", + "eval.tests.test_cli_help.test_top_level_help_lists_autoinherit_subcommand_exact", + "eval.tests.test_cli_help.test_top_level_help_long_flag_exact", + "eval.tests.test_cli_help.test_top_level_help_short_flag_exact", + "eval.tests.test_cli_help.test_version_flag_rejected_exact", + "eval.tests.test_dispatch_errors.test_error_return_code_is_one_for_engine_failures", + "eval.tests.test_dispatch_errors.test_exclude_members_metadata_array_with_non_string", + "eval.tests.test_dispatch_errors.test_exclude_members_metadata_not_array", + "eval.tests.test_dispatch_errors.test_invalid_toml_member_manifest_fails", + "eval.tests.test_dispatch_errors.test_nested_empty_dir_errors", + "eval.tests.test_dispatch_errors.test_outside_cargo_project_errors", + "eval.tests.test_dispatch_errors.test_root_package_without_workspace_field", + "eval.tests.test_module01_dispatch_extra.test_all_dep_kinds_combined_in_one_member", + "eval.tests.test_module01_dispatch_extra.test_already_inherited_workspace_unmodified", + "eval.tests.test_module01_dispatch_extra.test_clap_error_exit_code_two_full", + "eval.tests.test_module01_dispatch_extra.test_default_features_equal_across_members_shared", + "eval.tests.test_module01_dispatch_extra.test_default_features_mismatch_merges_to_false", + "eval.tests.test_module01_dispatch_extra.test_dev_and_build_deps_across_members_merge", + "eval.tests.test_module01_dispatch_extra.test_dotted_kept_inline_when_features_and_optional", + "eval.tests.test_module01_dispatch_extra.test_dotted_kept_inline_when_optional", + "eval.tests.test_module01_dispatch_extra.test_dotted_mixed_deps_inline_and_dotted", + "eval.tests.test_module01_dispatch_extra.test_dotted_plain_dep_default_and_flag_differ", + "eval.tests.test_module01_dispatch_extra.test_dotted_plain_dep_uses_dotted_form", + "eval.tests.test_module01_dispatch_extra.test_engine_error_prefix_and_caused_by", + "eval.tests.test_module01_dispatch_extra.test_engine_error_with_empty_exclude_value_fails", + "eval.tests.test_module01_dispatch_extra.test_exclude_all_members_leaves_workspace_deps_absent", + "eval.tests.test_module01_dispatch_extra.test_exclude_combined_with_prefer_simple_dotted", + "eval.tests.test_module01_dispatch_extra.test_exclude_via_equals_and_short_flag_equivalent", + "eval.tests.test_module01_dispatch_extra.test_help_outside_cargo_project_still_succeeds_full", + "eval.tests.test_module01_dispatch_extra.test_help_subcommand_matches_long_help_full", + "eval.tests.test_module01_dispatch_extra.test_multiple_features_preserved", + "eval.tests.test_module01_dispatch_extra.test_optional_true_inline_kept", + "eval.tests.test_module01_dispatch_extra.test_renamed_package_member_not_inherited_due_to_key_mismatch", + "eval.tests.test_module01_dispatch_extra.test_renamed_package_promoted_under_alias", + "eval.tests.test_module01_dispatch_extra.test_root_package_member_dependencies_rewritten", + "eval.tests.test_module01_dispatch_extra.test_subcommand_help_full_output", + "eval.tests.test_module01_dispatch_extra.test_subcommand_short_h_matches_long_help_full", + "eval.tests.test_module01_dispatch_extra.test_success_exit_code_zero_with_stdout_empty", + "eval.tests.test_module01_dispatch_extra.test_top_help_advertises_subcommand_in_order_full", + "eval.tests.test_module01_dispatch_extra.test_top_level_help_full_output", + "eval.tests.test_module01_dispatch_extra.test_top_level_help_short_flag_full_output", + "eval.tests.test_module01_dispatch_extra.test_workspace_with_no_deps_unmodified" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli.test_multiple_exclude_flags_accepted", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_no_subcommand_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_decor_preservation.test_inline_detailed_member_keeps_value_spacing[default_features_plus_features]", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- Blocking waiting for file lock on package cache error: failed to select a version for `serde`. ..", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_decor_preservation.test_nested_table_member_dep_replaced_with_dotted_inherit", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_decor_preservation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_decor_preservation.test_plain_value_member_dep_rewritten_with_normal_spacing", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_decor_preservation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_both_config_keys_are_reconized[hyphen_key]", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `bbb`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_both_config_keys_are_reconized[underscore_key]", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `bbb`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_cli_and_config_excludes_union", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `aaa`' in 'Excluded workspace member `bbb`\\n' + where 'Excluded workspace member `bbb`\\n' = CompletedProcess(args=['/workspace/golden-2/executable', '", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_both]", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `aaa`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_one_a]", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `aaa`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_one_b]", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `bbb`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_inherit_basic.test_default_features_false_inherited[default_features_false]", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- Blocking waiting for file lock on package cache error: failed to select a version for the require", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_inherit_basic.test_detailed_dep_keeps_metadata_in_member[default_features_plus_features]", + "reasons": [ + { + "detail": "AssertionError: assert {'version': '1.0', 'default-features': False} == '1.0'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_inherit_edge.test_existing_workspace_dep_is_not_clobbered[existing_major_only]", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- Blocking waiting for file lock on package cache error: failed to select a version for the require", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_inherit_edge.test_existing_workspace_dep_is_not_clobbered[existing_pinned_patch]", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- Blocking waiting for file lock on package cache error: failed to select a version for the require", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_inherit_edge.test_member_only_dep_that_is_already_workspace_reference_not_readded", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- error: failed to load manifest for workspace member `/tmp/pytest-of-root/pytest-1/popen-gw8/test_", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_multisource_skip.test_multisource_refused_and_sources_lists[version_display_within_caret]", + "reasons": [ + { + "detail": "assert ' - version: ^2.0.3' in \"`serde` won't be auto-inherited because there are multiple sources for it:\\n - version: ^1.0\\n - path: /tmp/pytest-of-root/pytest-1/popen-gw7/test_multisource_refused_a", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_multisource_skip.test_multisource_three_way_presents_all_sources", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- error: two packages named `anyhow` in this workspace: - /tmp/pytest-of-root/pytest-1/popen-gw6/te", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_multisource_skip.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_default_features_false_merges_with_enabled_sibling", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- error: duplicate key --> crates/a/Cargo.toml:6:2 | 6 | [dependencies] | ^^^^^^^^^^^^ error: faile", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_default_features_false_merges_with_false_sibling", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- error: duplicate key --> crates/a/Cargo.toml:6:2 | 6 | [dependencies] | ^^^^^^^^^^^^ error: faile", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_multisource_path_dep_with_version_prints_version_suffix", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_round4_engine_depth.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_nested_build_dependency_table_replaced_preserving_decor", + "reasons": [ + { + "detail": "AssertionError: cargo ('generate-lockfile', '--offline') failed (rc=101) --- stdout --- --- stderr --- Blocking waiting for file lock on package cache error: no matching package named `cc` found locat", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_round4_engine_depth.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_nested_table_member_dep_replaced_with_single_space_prefix", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_round4_engine_depth.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_depth.test_nested_table_replaced_with_plain_inherited_stmt_keeps_space", + "reasons": [ + { + "detail": "assert 'toml = { workspace = true }' in '[package]\\nname = \"a\"\\nversion = \"0.1.0\"\\nedition = \"2021\"\\n\\n[dependencies]\\ntoml= { workspace = true }\\n'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_round4_engine_depth.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_more.test_excluded_member_detailed_dep_left_untouched", + "reasons": [ + { + "detail": "AssertionError: assert 'Excluded workspace member `aaa`' in '' + where '' = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=0, stdout='', stderr='').stdout", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_round4_engine_more.test_underscore_dev_dependencies_section_shared_dep_inherited", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_round4_engine_more.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_round5_skip_diagnostics.test_registry_skip_diagnostic_matches_golden_file", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_round5_skip_diagnostics.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_workspace_dep_rewrite.test_root_manifest_golden_for_detailed_path_dep", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_workspace_dep_rewrite.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_workspace_errors.test_autoinherit_inside_non_cargo_dir_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_workspace_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_workspace_errors.test_workspace_with_zero_members_runs_cleanly", + "reasons": [ + { + "detail": "AssertionError: assert 1 == 0 + where 1 = CompletedProcess(args=['/workspace/golden-2/executable', 'autoinherit'], returncode=1, stdout='', stderr='Error: Faile...orkspace_with_zero_membe0` contains n", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli.test_autoinherit_help_lists_conf_flags", + "eval.tests.test_cli.test_autoinherit_subcommand_help[help_subcommand_autoinherit]", + "eval.tests.test_cli.test_autoinherit_subcommand_help[subcmd_long_help]", + "eval.tests.test_cli.test_autoinherit_subcommand_help[subcmd_short_h]", + "eval.tests.test_cli.test_missing_flag_value_usage_error[long_exclude_missing_value]", + "eval.tests.test_cli.test_missing_flag_value_usage_error[short_e_missing_value]", + "eval.tests.test_cli.test_multiple_exclude_flags_accepted", + "eval.tests.test_cli.test_no_subcommand_errors", + "eval.tests.test_cli.test_top_level_help[help_subcommand]", + "eval.tests.test_cli.test_top_level_help[long_help]", + "eval.tests.test_cli.test_top_level_help[short_h]", + "eval.tests.test_cli.test_top_level_help_does_not_list_conf_flags", + "eval.tests.test_cli.test_unknown_arguments_usage_error[unknown_subcmd_flag]", + "eval.tests.test_cli.test_unknown_arguments_usage_error[unknown_subcommand]", + "eval.tests.test_cli.test_unknown_arguments_usage_error[unknown_top_flag]", + "eval.tests.test_decor_preservation.test_inline_detailed_member_keeps_value_spacing[default_features_plus_features]", + "eval.tests.test_decor_preservation.test_inline_detailed_member_keeps_value_spacing[features_only]", + "eval.tests.test_decor_preservation.test_nested_table_member_dep_replaced_with_dotted_inherit", + "eval.tests.test_decor_preservation.test_plain_value_member_dep_rewritten_with_normal_spacing", + "eval.tests.test_decor_preservation.test_preserve_decor_when_member_already_has_detailed_entry_guarded_by_member_match", + "eval.tests.test_exclude_config.test_both_config_keys_are_reconized[hyphen_key]", + "eval.tests.test_exclude_config.test_both_config_keys_are_reconized[underscore_key]", + "eval.tests.test_exclude_config.test_cli_and_config_excludes_union", + "eval.tests.test_exclude_config.test_config_empty_array_no_exclusion", + "eval.tests.test_exclude_config.test_config_exclude_non_string_element_errors[float_elem]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_element_errors[int_elem]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_element_errors[mixed_ok_then_int]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_element_errors[nested_array]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_element_errors[two_bools]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_value_errors[bool]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_value_errors[int]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_value_errors[string]", + "eval.tests.test_exclude_config.test_config_exclude_non_string_value_errors[table]", + "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_both]", + "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_one_a]", + "eval.tests.test_exclude_config.test_config_exclude_skips_member[exclude_one_b]", + "eval.tests.test_exclude_config.test_config_exclude_unknown_member_prints_nothing_and_continues", + "eval.tests.test_exclude_config.test_excluded_member_dependency_not_centralized", + "eval.tests.test_inherit_basic.test_alias_dependency_inherited[explicit_package_same_name]", + "eval.tests.test_inherit_basic.test_caret_prefix_stripped_in_workspace[caret_minor]", + "eval.tests.test_inherit_basic.test_caret_prefix_stripped_in_workspace[caret_patch]", + "eval.tests.test_inherit_basic.test_caret_prefix_stripped_in_workspace[exact_plain]", + "eval.tests.test_inherit_basic.test_compatible_caret_versions_merged[merge_down_order_inv]", + "eval.tests.test_inherit_basic.test_compatible_caret_versions_merged[merge_upgrade_patch]", + "eval.tests.test_inherit_basic.test_compatible_caret_versions_merged[same_version]", + "eval.tests.test_inherit_basic.test_default_features_false_inherited[default_features_false]", + "eval.tests.test_inherit_basic.test_detailed_dep_keeps_metadata_in_member[default_features_plus_features]", + "eval.tests.test_inherit_basic.test_detailed_dep_keeps_metadata_in_member[features_and_optional]", + "eval.tests.test_inherit_basic.test_detailed_dep_keeps_metadata_in_member[features_only]", + "eval.tests.test_inherit_basic.test_detailed_dep_keeps_metadata_in_member[optional_only]", + "eval.tests.test_inherit_basic.test_dev_and_build_deps_inherited[dev_and_build]", + "eval.tests.test_inherit_basic.test_dotted_vs_braced_member_inheritance[default_braced]", + "eval.tests.test_inherit_basic.test_dotted_vs_braced_member_inheritance[prefer_simple_dotted]", + "eval.tests.test_inherit_basic.test_path_dependency_to_workspace_member_inherited", + "eval.tests.test_inherit_basic.test_shared_simple_dep_inherited[anyhow]", + "eval.tests.test_inherit_basic.test_shared_simple_dep_inherited[semver]", + "eval.tests.test_inherit_basic.test_shared_simple_dep_inherited[serde]", + "eval.tests.test_inherit_basic.test_shared_simple_dep_inherited[toml]", + "eval.tests.test_inherit_basic.test_single_member_simple_dep_centralized", + "eval.tests.test_inherit_basic.test_underscore_and_hyphen_section_names[build_hyphen]", + "eval.tests.test_inherit_basic.test_underscore_and_hyphen_section_names[build_underscore]", + "eval.tests.test_inherit_basic.test_underscore_and_hyphen_section_names[dev_hyphen]", + "eval.tests.test_inherit_basic.test_underscore_and_hyphen_section_names[dev_underscore]", + "eval.tests.test_inherit_edge.test_existing_workspace_dep_is_not_clobbered[existing_major_only]", + "eval.tests.test_inherit_edge.test_existing_workspace_dep_is_not_clobbered[existing_pinned_patch]", + "eval.tests.test_inherit_edge.test_idempotent_run_when_all_deps_already_inherited", + "eval.tests.test_inherit_edge.test_member_only_dep_that_is_already_workspace_reference_not_readded", + "eval.tests.test_inherit_edge.test_mixed_already_inherited_and_plain_member", + "eval.tests.test_inherit_edge.test_root_workspace_dep_processing_when_table_present", + "eval.tests.test_multisource_skip.test_multisource_isolation_only_affects_that_package", + "eval.tests.test_multisource_skip.test_multisource_refused_and_sources_lists[version_display_caret]", + "eval.tests.test_multisource_skip.test_multisource_refused_and_sources_lists[version_display_within_caret]", + "eval.tests.test_multisource_skip.test_multisource_three_way_presents_all_sources", + "eval.tests.test_round4_engine_depth.test_default_features_false_merges_with_enabled_sibling", + "eval.tests.test_round4_engine_depth.test_default_features_false_merges_with_false_sibling", + "eval.tests.test_round4_engine_depth.test_detailed_build_dependency_centralised", + "eval.tests.test_round4_engine_depth.test_detailed_dep_features_and_optional_retained", + "eval.tests.test_round4_engine_depth.test_detailed_dev_dep_dotted_vs_braced_inheritance[braced]", + "eval.tests.test_round4_engine_depth.test_detailed_dev_dep_dotted_vs_braced_inheritance[dotted]", + "eval.tests.test_round4_engine_depth.test_detailed_dev_dependency_centralised_and_inherited", + "eval.tests.test_round4_engine_depth.test_multisource_path_dep_with_version_prints_version_suffix", + "eval.tests.test_round4_engine_depth.test_multisource_path_dep_without_version_has_no_version_suffix", + "eval.tests.test_round4_engine_depth.test_nested_build_dependency_table_replaced_preserving_decor", + "eval.tests.test_round4_engine_depth.test_nested_table_member_dep_replaced_with_single_space_prefix", + "eval.tests.test_round4_engine_depth.test_nested_table_replaced_with_plain_inherited_stmt_keeps_space", + "eval.tests.test_round4_engine_depth.test_path_dep_with_version_default_features_false", + "eval.tests.test_round4_engine_depth.test_plain_path_dep_with_version_centralised_relative", + "eval.tests.test_round4_engine_more.test_deep_nested_member_path_dep_rewritten_relative_to_root", + "eval.tests.test_round4_engine_more.test_excluded_member_detailed_dep_left_untouched", + "eval.tests.test_round4_engine_more.test_idempotent_dotted_rerun_stable", + "eval.tests.test_round4_engine_more.test_new_member_dep_inherited_into_existing_root_table_not_clobbered", + "eval.tests.test_round4_engine_more.test_no_dependencies_workspace_left_unchanged", + "eval.tests.test_round4_engine_more.test_two_members_share_dep_only_one_has_detailed_optional", + "eval.tests.test_round4_engine_more.test_underscore_dev_dependencies_section_shared_dep_inherited", + "eval.tests.test_round5_existing_table_rerun.test_member_dev_dep_still_centralised_when_an_unrelated_root_dep_is_skipped", + "eval.tests.test_round5_existing_table_rerun.test_root_nested_table_for_one_pkg_does_not_block_new_sibling", + "eval.tests.test_round5_existing_table_rerun.test_root_nested_workspace_dep_table_is_preserved_and_member_inherits", + "eval.tests.test_round5_existing_table_rerun.test_root_nested_workspace_dep_table_rerun_stable", + "eval.tests.test_round5_existing_table_rerun.test_unsupported_source_skip_rerun_stable", + "eval.tests.test_round5_skip_diagnostics.test_cli_excluded_member_does_not_hide_skip_diagnostic", + "eval.tests.test_round5_skip_diagnostics.test_excluded_member_with_skipped_ws_dep_prints_no_member_action", + "eval.tests.test_round5_skip_diagnostics.test_multiple_unsupported_workspace_deps_each_print_one_line", + "eval.tests.test_round5_skip_diagnostics.test_no_source_detailed_workspace_dep_skipped[features_and_optional]", + "eval.tests.test_round5_skip_diagnostics.test_no_source_detailed_workspace_dep_skipped[features_only]", + "eval.tests.test_round5_skip_diagnostics.test_registry_index_workspace_dep_skipped[serde]", + "eval.tests.test_round5_skip_diagnostics.test_registry_index_workspace_dep_skipped[toml]", + "eval.tests.test_round5_skip_diagnostics.test_registry_skip_diagnostic_matches_golden_file", + "eval.tests.test_round5_skip_diagnostics.test_registry_workspace_dep_skipped_with_stable_diagnostic[ahash]", + "eval.tests.test_round5_skip_diagnostics.test_registry_workspace_dep_skipped_with_stable_diagnostic[serde]", + "eval.tests.test_round5_skip_diagnostics.test_registry_workspace_dep_skipped_with_stable_diagnostic[toml]", + "eval.tests.test_round5_skip_diagnostics.test_skipped_package_does_not_block_valid_sibling_inherit", + "eval.tests.test_round5_skip_diagnostics.test_skipped_package_under_dotted_flag_still_skipped", + "eval.tests.test_round5_skip_diagnostics.test_skipped_package_with_member_version_source_and_root_registry", + "eval.tests.test_workspace_dep_rewrite.test_default_features_false_writes_key_in_workspace", + "eval.tests.test_workspace_dep_rewrite.test_multiple_detailed_shared_deps_all_serialised", + "eval.tests.test_workspace_dep_rewrite.test_path_dep_rewritten_relative_to_workspace_root", + "eval.tests.test_workspace_dep_rewrite.test_plain_simple_shared_dep_stored_as_bare_string", + "eval.tests.test_workspace_dep_rewrite.test_root_manifest_golden_for_detailed_path_dep", + "eval.tests.test_workspace_errors.test_autoinherit_error_mentions_root_path", + "eval.tests.test_workspace_errors.test_autoinherit_in_cargo_project_without_workspace_errors", + "eval.tests.test_workspace_errors.test_autoinherit_in_workspace_member_subdir_succeeds", + "eval.tests.test_workspace_errors.test_autoinherit_inside_non_cargo_dir_errors", + "eval.tests.test_workspace_errors.test_workspace_with_zero_members_runs_cleanly" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_dedup_equal_arm.test_default_features_true_emitted_as_simple", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_equal_arm.test_equal_arm_anyhow_patch_variants", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_equal_arm.test_equal_arm_first_patch_higher", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_equal_arm.test_equal_arm_first_patch_lower", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_equal_arm.test_equal_arm_identical_patch", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_equal_arm.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_merge.test_equal_arm_lower_first_patch_wins_max", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_merge.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_merge.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_merge.test_equal_arm_second_higher_patch", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_merge.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_merge.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_minor_branch.test_merge_first_minor_greater_than_second", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_minor_branch.test_merge_first_minor_less_second_position", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_minor_branch.test_merge_first_minor_less_than_second", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_minor_branch.test_path_source_and_version_source_kept_separate", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_dedup_minor_branch.test_three_members_distinct_minors_collapse_to_max", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_dedup_minor_branch.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_dedup_cli_behavior.test_different_major_not_merged_thiserror", + "eval.tests.test_dedup_cli_behavior.test_dotted_rewrite_with_merged_shared_req", + "eval.tests.test_dedup_cli_behavior.test_exact_operator_only_not_merged", + "eval.tests.test_dedup_cli_behavior.test_exclude_members_long_flag", + "eval.tests.test_dedup_cli_behavior.test_exclude_members_preserves_order_message", + "eval.tests.test_dedup_cli_behavior.test_exclude_members_short_flag", + "eval.tests.test_dedup_cli_behavior.test_exclude_members_via_workspace_metadata", + "eval.tests.test_dedup_cli_behavior.test_major_zero_same_minor_libc_merges", + "eval.tests.test_dedup_cli_behavior.test_operator_range_not_merged", + "eval.tests.test_dedup_cli_behavior.test_prefer_simple_dotted_rewrites_members", + "eval.tests.test_dedup_cli_behavior.test_wildcard_with_noncaret_merges_to_specific", + "eval.tests.test_dedup_equal_arm.test_default_features_false_dominates_equal_minor", + "eval.tests.test_dedup_equal_arm.test_default_features_false_exact_same_source", + "eval.tests.test_dedup_equal_arm.test_default_features_true_emitted_as_simple", + "eval.tests.test_dedup_equal_arm.test_equal_arm_anyhow_patch_variants", + "eval.tests.test_dedup_equal_arm.test_equal_arm_first_patch_higher", + "eval.tests.test_dedup_equal_arm.test_equal_arm_first_patch_lower", + "eval.tests.test_dedup_equal_arm.test_equal_arm_identical_patch", + "eval.tests.test_dedup_merge.test_caret_leading_caret_stripped_in_output", + "eval.tests.test_dedup_merge.test_distinct_crates_each_get_shared_requirement", + "eval.tests.test_dedup_merge.test_equal_arm_lower_first_patch_wins_max", + "eval.tests.test_dedup_merge.test_equal_arm_second_higher_patch", + "eval.tests.test_dedup_merge.test_identical_requirement_deduped", + "eval.tests.test_dedup_merge.test_merge_caret_into_shared", + "eval.tests.test_dedup_merge.test_merge_equal_patch_max_major_nonzero", + "eval.tests.test_dedup_merge.test_merge_major_zero_same_minor", + "eval.tests.test_dedup_merge.test_single_dependency_still_centralized", + "eval.tests.test_dedup_merge.test_three_members_single_shared_requirement", + "eval.tests.test_dedup_minor_branch.test_merge_first_minor_greater_than_second", + "eval.tests.test_dedup_minor_branch.test_merge_first_minor_less_second_position", + "eval.tests.test_dedup_minor_branch.test_merge_first_minor_less_than_second", + "eval.tests.test_dedup_minor_branch.test_path_source_and_version_source_kept_separate", + "eval.tests.test_dedup_minor_branch.test_prerelease_caret_never_merged", + "eval.tests.test_dedup_minor_branch.test_three_members_distinct_minors_collapse_to_max", + "eval.tests.test_dedup_mixed_dep_kinds.test_all_three_dep_kinds_collapse_to_one", + "eval.tests.test_dedup_mixed_dep_kinds.test_build_dependencies_merge_across_members", + "eval.tests.test_dedup_mixed_dep_kinds.test_dev_dep_distinct_crates_each_centralized", + "eval.tests.test_dedup_mixed_dep_kinds.test_dev_dependencies_merge_across_members", + "eval.tests.test_dedup_mixed_dep_kinds.test_dev_dependency_default_features_false_merge", + "eval.tests.test_dedup_mixed_dep_kinds.test_dev_dependency_less_minor_arm", + "eval.tests.test_dedup_mixed_dep_kinds.test_mixed_kinds_wildcard_vs_concrete", + "eval.tests.test_dedup_mixed_dep_kinds.test_same_crate_normal_and_dev_deps_merge_to_one", + "eval.tests.test_dedup_mixed_dep_kinds.test_single_dev_dependency_still_centralized", + "eval.tests.test_dedup_wildcard_nonmerge.test_different_major_not_merged", + "eval.tests.test_dedup_wildcard_nonmerge.test_multi_comparator_range_not_merged", + "eval.tests.test_dedup_wildcard_nonmerge.test_single_non_caret_comparator_not_merged", + "eval.tests.test_dedup_wildcard_nonmerge.test_two_wildcards_merge_to_star", + "eval.tests.test_dedup_wildcard_nonmerge.test_wildcard_and_specific_merge_to_specific", + "eval.tests.test_dedup_wildcard_nonmerge.test_wildcard_in_second_position_keeps_specific" + ] + } + }, + "commit": "0bb5bee3fad1c0623cac1ca8dfeebc539099f75e", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9283958522567137, + "eval_clean_hashes": [ + "ce1324aea7c4daa530ef27ecfe229eb82f6053a7ff93b33500c1500ea3bca061" + ], + "input_record": { + "codeql_db_mb": 84.2, + "codeql_status": true, + "codeql_time": 47.84852749388665, + "commit": "0bb5bee3fad1c0623cac1ca8dfeebc539099f75e", + "commits": 43, + "contributors": 10, + "difficulty": "easy", + "difficulty_code_lines": 848, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 848, + "difficulty_runtime_deps": 9, + "difficulty_score": 1.9283958522567137, + "difficulty_test_code_lines": 0, + "full_name": "mainmatter/cargo-autoinherit", + "github_stars": 240, + "input_codeql_db": "rust_codeql/mainmatter__cargo-autoinherit", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "BurntSushi/ripgrep", + "rank": 249, + "similarity": 0.45729246735572815 + }, + { + "pb_fullname": "rvben/rumdl", + "rank": 986, + "similarity": 0.4270569384098053 + }, + { + "pb_fullname": "foriequal0/git-trim", + "rank": 436, + "similarity": 0.39783555269241333 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 396, + "similarity": 0.47676336765289307 + }, + { + "pb_fullname": "rust-embedded/svd2rust", + "rank": 789, + "similarity": 0.49909335374832153 + }, + { + "pb_fullname": "cordx56/rustowl", + "rank": 545, + "similarity": 0.5987233519554138 + }, + { + "pb_fullname": "ismaelgv/rnr", + "rank": 623, + "similarity": 0.4047919511795044 + }, + { + "pb_fullname": "astro/deadnix", + "rank": 174, + "similarity": 0.5311230421066284 + }, + { + "pb_fullname": "sigoden/argc", + "rank": 840, + "similarity": 0.44676488637924194 + }, + { + "pb_fullname": "parcel-bundler/lightningcss", + "rank": 440, + "similarity": 0.46908313035964966 + }, + { + "pb_fullname": "pls-rs/pls", + "rank": 763, + "similarity": 0.43088293075561523 + }, + { + "pb_fullname": "Byron/dua-cli", + "rank": 761, + "similarity": 0.43127238750457764 + } + ], + "repo_age": 2.41, + "repo_path": "rust/mainmatter__cargo-autoinherit", + "rust_channel": "stable", + "rust_edition": "2021", + "rust_release_date": "2021-10-21", + "rust_version": "1.56.0", + "rust_version_source": "edition", + "source": "commit:0bb5bee3fad1c0623cac1ca8dfeebc539099f75e", + "status": "done", + "url": "https://github.com/mainmatter/cargo-autoinherit" + }, + "instance_id": "mainmatter__cargo-autoinherit.0bb5bee", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "mainmatter/cargo-autoinherit" +} diff --git a/mainmatter--cargo-autoinherit.0b/tests/test.sh b/mainmatter--cargo-autoinherit.0b/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mainmatter--cargo-autoinherit.0b/tests/workspace.tar.gz b/mainmatter--cargo-autoinherit.0b/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d23bae3dcaa4db626bd29c3687040b893fa490ca --- /dev/null +++ b/mainmatter--cargo-autoinherit.0b/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:939d482dd2d8ab03b16dee333b0f46110dcca8b7d5da9076e1249d3e2f4c60a8 +size 6483 diff --git a/majerle--lwrb.eb95819/environment/Dockerfile b/majerle--lwrb.eb95819/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8acccc9e7709c4fa205034773e0c1c02b32a9d89 --- /dev/null +++ b/majerle--lwrb.eb95819/environment/Dockerfile @@ -0,0 +1,56 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +# programgym_quota_aware_nproc=1 +RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/majerle--lwrb.eb95819/environment/download.sh b/majerle--lwrb.eb95819/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f3cc48e2bba4cf2376101c1fa30efa39590c3d88 --- /dev/null +++ b/majerle--lwrb.eb95819/environment/download.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# download.sh - ProgramGym download stage for the lwrb demo build. +# +# lwrb is a dependency-free C11 ring-buffer library. The selected target +# (top-level demo executable LwLibPROJECT built from dev/main.c) links only the +# project-owned static libraries lwrb and lwrb_ex and the C standard library. +# There are no third-party dependencies to download, unpack, or install, and no +# apt packages are needed beyond the base-image C toolchain. +# +# This script is executed via `source /source_ro/download.sh`, so it must be +# valid in shell source mode: +# - It only exports environment variables. +# - It does not read any repository build or source file. +# - It does not compile, link, test, package, or install anything. +# - It never calls exit in normal control flow. +# - It is idempotent: repeated sourcing has no side effects. +# +# Everything build.sh needs is declared explicitly here (no repo manifest is +# consulted). + +# Build configuration consumed by build.sh. Defaults are provided so build.sh +# also works standalone, but these are exported here to keep the contract. +export LWRB_BUILD_DIR="${LWRB_BUILD_DIR:-build}" +export LWRB_BUILD_TYPE="${LWRB_BUILD_TYPE:-Debug}" + +# lwrb has no external dependencies to prefetch. No downloads, no package +# installs, no cache preparation are required. Everything is done by export +# above, which is enough for the offline build stage. +printf '[download] lwrb has no third-party dependencies; nothing to prefetch.\n' diff --git a/majerle--lwrb.eb95819/environment/executable b/majerle--lwrb.eb95819/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..22361a9c658646959f08a1a5f3dd4375a547bfce Binary files /dev/null and b/majerle--lwrb.eb95819/environment/executable differ diff --git a/majerle--lwrb.eb95819/environment/harbor_prepare_download_env.sh b/majerle--lwrb.eb95819/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/majerle--lwrb.eb95819/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/majerle--lwrb.eb95819/environment/workspace.tar.gz b/majerle--lwrb.eb95819/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..607f01c49d647339187526412096d71a0a0e7203 --- /dev/null +++ b/majerle--lwrb.eb95819/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99031f6f1e069efe0f9e2fd02e44df3effbe23affe6be8af2ad3a14ce46dc2fb +size 4992 diff --git a/majerle--lwrb.eb95819/instruction.md b/majerle--lwrb.eb95819/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/majerle--lwrb.eb95819/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/majerle--lwrb.eb95819/solution/solve.sh b/majerle--lwrb.eb95819/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/majerle--lwrb.eb95819/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/majerle--lwrb.eb95819/task.toml b/majerle--lwrb.eb95819/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6f4b4c20e581e252473f71098d914fd4d004c986 --- /dev/null +++ b/majerle--lwrb.eb95819/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/majerle--lwrb.eb95819" +description = "Synthetic ProgramGym cleanroom reconstruction task for MaJerle/lwrb" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "c"] + +[metadata] +source = "ProgramGym" +instance_id = "MaJerle__lwrb.eb95819" +repository = "MaJerle/lwrb" +commit = "eb958194b81b5344a58b6fa19965edc6ccb42dd2" +language = "c" +difficulty = "easy" +difficulty_score = 1.2624510897304293 +test_branches = 4 +test_count = 558 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/majerle--lwrb.eb95819/tests/Dockerfile b/majerle--lwrb.eb95819/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..af44b3d1754339c76f5704a76db5a06fd46920ab --- /dev/null +++ b/majerle--lwrb.eb95819/tests/Dockerfile @@ -0,0 +1,70 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +# programgym_quota_aware_nproc=1 +RUN set -eux; printf '%s\n' '#!/bin/sh' 'if [ "$#" -gt 0 ]; then exec /usr/bin/nproc "$@"; fi' 'visible="$(/usr/bin/nproc)"' 'quota=""' 'period=""' 'if [ -r /sys/fs/cgroup/cpu.max ]; then' ' set -- $(cat /sys/fs/cgroup/cpu.max)' ' quota="${1:-}"' ' period="${2:-}"' 'elif [ -r /sys/fs/cgroup/cpu/cpu.cfs_quota_us ] && [ -r /sys/fs/cgroup/cpu/cpu.cfs_period_us ]; then' ' quota="$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)"' ' period="$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)"' fi 'if [ -n "$quota" ] && [ "$quota" != max ] && [ "$quota" -gt 0 ] 2>/dev/null && [ "$period" -gt 0 ] 2>/dev/null; then' ' limit=$(( (quota + period - 1) / period ))' ' if [ "$limit" -lt 1 ]; then limit=1; fi' ' if [ "$limit" -lt "$visible" ]; then visible="$limit"; fi' fi 'printf "%s\n" "$visible"' > /usr/local/bin/nproc; chmod 0755 /usr/local/bin/nproc; /usr/local/bin/nproc >/dev/null +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN set -eu; \ + pip_break_system_packages=""; \ + if python3 -m pip install --help | grep -q -- '--break-system-packages'; then \ + pip_break_system_packages="--break-system-packages"; \ + fi; \ + python3 -m pip install ${pip_break_system_packages} \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_01.tar.gz b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5405638a684dc5e7e36cbba06b902a5bb9ef2493 --- /dev/null +++ b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80ea279087ad7a772d837c0cea40189aad1cc3dc30005e7fbb89010b5045a175 +size 27532 diff --git a/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_02.tar.gz b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..37d862429d750be61728853c980807d9336a2262 --- /dev/null +++ b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bce4b1ef70ca9ca72667e2b0c5d6e2dc9de242b2b9487c8d546148a387feae94 +size 5462 diff --git a/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_03.tar.gz b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..72af15d810cfb8c670a05fa8cfff7b8d68535faa --- /dev/null +++ b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:119ae4b7cf533ccf14385096410492bc0a5fe11a0e7fe92ca025f71f4f3bf1c7 +size 7410 diff --git a/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_04.tar.gz b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ceb133b8f2816fee0c7d2617fa3173c5d291d46b --- /dev/null +++ b/majerle--lwrb.eb95819/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cf4fa466d556bb9443ad54fca15adf8025c447d4b07fd938d9cddd3c7bbe83d +size 26802 diff --git a/majerle--lwrb.eb95819/tests/download.sh b/majerle--lwrb.eb95819/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..f3cc48e2bba4cf2376101c1fa30efa39590c3d88 --- /dev/null +++ b/majerle--lwrb.eb95819/tests/download.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# download.sh - ProgramGym download stage for the lwrb demo build. +# +# lwrb is a dependency-free C11 ring-buffer library. The selected target +# (top-level demo executable LwLibPROJECT built from dev/main.c) links only the +# project-owned static libraries lwrb and lwrb_ex and the C standard library. +# There are no third-party dependencies to download, unpack, or install, and no +# apt packages are needed beyond the base-image C toolchain. +# +# This script is executed via `source /source_ro/download.sh`, so it must be +# valid in shell source mode: +# - It only exports environment variables. +# - It does not read any repository build or source file. +# - It does not compile, link, test, package, or install anything. +# - It never calls exit in normal control flow. +# - It is idempotent: repeated sourcing has no side effects. +# +# Everything build.sh needs is declared explicitly here (no repo manifest is +# consulted). + +# Build configuration consumed by build.sh. Defaults are provided so build.sh +# also works standalone, but these are exported here to keep the contract. +export LWRB_BUILD_DIR="${LWRB_BUILD_DIR:-build}" +export LWRB_BUILD_TYPE="${LWRB_BUILD_TYPE:-Debug}" + +# lwrb has no external dependencies to prefetch. No downloads, no package +# installs, no cache preparation are required. Everything is done by export +# above, which is enough for the offline build stage. +printf '[download] lwrb has no third-party dependencies; nothing to prefetch.\n' diff --git a/majerle--lwrb.eb95819/tests/executable b/majerle--lwrb.eb95819/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..22361a9c658646959f08a1a5f3dd4375a547bfce Binary files /dev/null and b/majerle--lwrb.eb95819/tests/executable differ diff --git a/majerle--lwrb.eb95819/tests/harbor_prepare_download_env.sh b/majerle--lwrb.eb95819/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/majerle--lwrb.eb95819/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/majerle--lwrb.eb95819/tests/programgym_evaluator.py b/majerle--lwrb.eb95819/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/majerle--lwrb.eb95819/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/majerle--lwrb.eb95819/tests/programgym_task.json b/majerle--lwrb.eb95819/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..534e5a1ec0b841e02db03caad70d5bd4d3e9ae7c --- /dev/null +++ b/majerle--lwrb.eb95819/tests/programgym_task.json @@ -0,0 +1,694 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_aggregates.test_extended_write_used_counts_follow_pointers", + "eval.tests.test_aggregates.test_find_found_and_not_found_counts", + "eval.tests.test_aggregates.test_find_needle_sequence_is_documented_order", + "eval.tests.test_aggregates.test_max_reported_bytes_across_sections_is_usable_capacity", + "eval.tests.test_aggregates.test_move_moved_lengths_sum_to_total", + "eval.tests.test_aggregates.test_overwrite_fifo_eviction_is_contiguous", + "eval.tests.test_aggregates.test_parsed_records_round_trip_golden_across_all_sections", + "eval.tests.test_aggregates.test_rw_used_sequence_matches_signed_operation_lengths", + "eval.tests.test_aggregates.test_rw_wrap_operation_reports_used_equal_to_write_length", + "eval.tests.test_find.test_find_cross_section_record_count", + "eval.tests.test_find.test_find_every_result_carries_passing_selfcheck", + "eval.tests.test_find.test_find_found_indices_stay_within_payload", + "eval.tests.test_find.test_find_needle_length_field_matches_input_len", + "eval.tests.test_find.test_find_not_found_rows_report_zero_index", + "eval.tests.test_find.test_find_reports_offset_of_first_occurrence", + "eval.tests.test_find.test_find_respects_start_offset", + "eval.tests.test_find.test_find_result[find_123_at_0]", + "eval.tests.test_find.test_find_result[find_456_at_3]", + "eval.tests.test_find.test_find_result[find_678_at_5]", + "eval.tests.test_find.test_find_result[not_find_123_from_offset_1]", + "eval.tests.test_find.test_find_result[offset_scenario_find_123]", + "eval.tests.test_find.test_find_result[offset_scenario_find_456]", + "eval.tests.test_find.test_find_result[offset_scenario_not_find_123]", + "eval.tests.test_find.test_find_result[wrap_scenario_find_1234]", + "eval.tests.test_find.test_find_result[wrap_scenario_find_4567]", + "eval.tests.test_find.test_find_result[wrap_scenario_not_find_1234]", + "eval.tests.test_find.test_find_works_when_search_crosses_pointer_wrap", + "eval.tests.test_golden.test_as_expected_flag_count_matches_golden", + "eval.tests.test_golden.test_done_marker_closes_the_run", + "eval.tests.test_golden.test_every_as_expected_flag_is_satisfied", + "eval.tests.test_golden.test_no_selfcheck_failure_message", + "eval.tests.test_golden.test_returncode_is_zero", + "eval.tests.test_golden.test_section_header_present[section_extended]", + "eval.tests.test_golden.test_section_header_present[section_find]", + "eval.tests.test_golden.test_section_header_present[section_move]", + "eval.tests.test_golden.test_section_header_present[section_overwrite]", + "eval.tests.test_golden.test_section_header_present[section_peek]", + "eval.tests.test_golden.test_section_header_present[section_read_write]", + "eval.tests.test_golden.test_stderr_is_empty", + "eval.tests.test_golden.test_stdout_matches_golden_exactly", + "eval.tests.test_invariants.test_rw_empty_state_is_signalled_by_equal_pointers", + "eval.tests.test_invariants.test_rw_iteration_never_overshoots_requested_length", + "eval.tests.test_invariants.test_rw_state_transition_advances_by_reported_length", + "eval.tests.test_invariants.test_rw_used_bounded_by_usable_capacity", + "eval.tests.test_invariants.test_rw_used_matches_cumulative_write_read_balance", + "eval.tests.test_invariants.test_rw_wrap_keeps_occupied_coherent", + "eval.tests.test_move.test_move_cross_section_record_count", + "eval.tests.test_move.test_move_destination_payload_is_the_prefix_of_full_stream", + "eval.tests.test_move.test_move_every_row_passes_selfcheck", + "eval.tests.test_move.test_move_into_filled_destination_keeps_existing_bytes", + "eval.tests.test_move.test_move_lengths_monotonically_match_capability", + "eval.tests.test_move.test_move_result[move_6_exact]", + "eval.tests.test_move.test_move_result[move_capped_to_dst_capacity_7]", + "eval.tests.test_move.test_move_result[move_partial_into_filled_dst_7]", + "eval.tests.test_overwrite.test_overwrite_content[append_0_len7]", + "eval.tests.test_overwrite.test_overwrite_content[append_1_len8]", + "eval.tests.test_overwrite.test_overwrite_content[evict_b_012]", + "eval.tests.test_overwrite.test_overwrite_content[evict_c_123]", + "eval.tests.test_overwrite.test_overwrite_content[evict_d_234]", + "eval.tests.test_overwrite.test_overwrite_content[evict_e_345]", + "eval.tests.test_overwrite.test_overwrite_content[large_evict_to_structure]", + "eval.tests.test_overwrite.test_overwrite_content[seed_6]", + "eval.tests.test_overwrite.test_overwrite_cross_section_record_count", + "eval.tests.test_overwrite.test_overwrite_every_row_passes_selfcheck", + "eval.tests.test_overwrite.test_overwrite_is_first_in_first_out_eviction", + "eval.tests.test_overwrite.test_overwrite_large_payload_coalesces_new_bytes", + "eval.tests.test_overwrite.test_overwrite_max_capacity_is_size_minus_one", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[needle_123_at_0]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[needle_456_at_3]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[needle_678_at_5]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[offset123_at_0]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[offset456_at_3]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[wrap_1234_at_0]", + "eval.tests.test_payload_consistency.test_find_found_index_points_at_matching_bytes[wrap_4567_at_3]", + "eval.tests.test_payload_consistency.test_find_found_indexes_are_strictly_inside_payload_bounds", + "eval.tests.test_payload_consistency.test_find_not_found_offset_does_not_match_payload[reject_1234_from_1]", + "eval.tests.test_payload_consistency.test_find_not_found_offset_does_not_match_payload[reject_123_from_1]", + "eval.tests.test_payload_consistency.test_find_not_found_offset_does_not_match_payload[reject_123_from_1_again]", + "eval.tests.test_payload_consistency.test_move_dest_content_is_source_stream_prefix", + "eval.tests.test_payload_consistency.test_move_dest_length_matches_reported_moved_bytes", + "eval.tests.test_payload_consistency.test_move_into_seeded_dest_appends_source_bytes", + "eval.tests.test_payload_consistency.test_move_whole_source_into_empty_dest_is_unbounded_by_capacity", + "eval.tests.test_payload_consistency.test_overwrite_returns_the_newest_window_of_source_stream", + "eval.tests.test_payload_consistency.test_overwrite_seed_then_single_bytes_rebuild_stream_head", + "eval.tests.test_peek.test_peek_no_failure_message", + "eval.tests.test_peek.test_peek_section_header_then_done_only", + "eval.tests.test_peek.test_peek_section_is_a_single_terminated_block", + "eval.tests.test_peek.test_peek_section_matches_golden", + "eval.tests.test_peek.test_peek_validity_preserves_exit_success", + "eval.tests.test_read_write.test_read_write_pointer_transition[first_write_w3_r0]", + "eval.tests.test_read_write.test_read_write_pointer_transition[read_advances_r_to_3]", + "eval.tests.test_read_write.test_read_write_pointer_transition[second_read_r_to_6]", + "eval.tests.test_read_write.test_read_write_pointer_transition[second_write_w6_r0]", + "eval.tests.test_read_write.test_read_write_pointer_transition[write_wraps_w_back_to_0]", + "eval.tests.test_read_write.test_read_write_sequence_is_fully_expected", + "eval.tests.test_read_write.test_rw_section_line_count", + "eval.tests.test_read_write.test_rw_sequence_matches_golden", + "eval.tests.test_reference_model.test_extended_full_sequence_matches_model", + "eval.tests.test_reference_model.test_extended_row_matches_model[row0_write_all_success]", + "eval.tests.test_reference_model.test_extended_row_matches_model[row1_read3]", + "eval.tests.test_reference_model.test_extended_row_matches_model[row2_r_advanced_to_3]", + "eval.tests.test_reference_model.test_extended_row_matches_model[row3_write_all_rejected]", + "eval.tests.test_reference_model.test_extended_row_matches_model[row4_read_frees]", + "eval.tests.test_reference_model.test_extended_row_matches_model[row5_write_all_accepted]", + "eval.tests.test_reference_model.test_find_full_sequence_matches_model", + "eval.tests.test_reference_model.test_find_row_matches_model[A_find_123]", + "eval.tests.test_reference_model.test_find_row_matches_model[A_find_456]", + "eval.tests.test_reference_model.test_find_row_matches_model[A_find_678]", + "eval.tests.test_reference_model.test_find_row_matches_model[A_reject_123_off1]", + "eval.tests.test_reference_model.test_find_row_matches_model[B_find_123]", + "eval.tests.test_reference_model.test_find_row_matches_model[B_find_456]", + "eval.tests.test_reference_model.test_find_row_matches_model[B_reject_123_off1]", + "eval.tests.test_reference_model.test_find_row_matches_model[C_find_1234]", + "eval.tests.test_reference_model.test_find_row_matches_model[C_reject_1234_off1]", + "eval.tests.test_reference_model.test_find_row_matches_model[C_wrap_find_4567]", + "eval.tests.test_reference_model.test_model_capacity_bound_holds_for_all_derived_states", + "eval.tests.test_reference_model.test_rw_full_sequence_matches_model", + "eval.tests.test_reference_model.test_rw_row_matches_model[step0_first_write]", + "eval.tests.test_reference_model.test_rw_row_matches_model[step1_second_write]", + "eval.tests.test_reference_model.test_rw_row_matches_model[step2_first_read]", + "eval.tests.test_reference_model.test_rw_row_matches_model[step3_short_read]", + "eval.tests.test_reference_model.test_rw_row_matches_model[step4_write_wrap]", + "eval.tests.test_sections.test_adjacent_pair_ordering[ext_before_overwrite]", + "eval.tests.test_sections.test_adjacent_pair_ordering[find_before_peek]", + "eval.tests.test_sections.test_adjacent_pair_ordering[move_before_find]", + "eval.tests.test_sections.test_adjacent_pair_ordering[overwrite_before_move]", + "eval.tests.test_sections.test_adjacent_pair_ordering[peek_before_done]", + "eval.tests.test_sections.test_adjacent_pair_ordering[rw_before_ext]", + "eval.tests.test_sections.test_sections_appear_in_expected_order", + "eval.tests.test_sections.test_sections_order_matches_golden", + "eval.tests.test_write_extended.test_atomic_read_all_flags_are_satisfied", + "eval.tests.test_write_extended.test_atomic_write_all_accepted_after_reading", + "eval.tests.test_write_extended.test_atomic_write_all_rejects_when_insufficient", + "eval.tests.test_write_extended.test_ext_cross_section_record_count", + "eval.tests.test_write_extended.test_ext_every_row_passes_selfcheck", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row0_write_all_7_success]", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row1_read_3_success]", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row2_write_r3_len7]", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row3_full_write_rejected]", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row4_read_frees_space]", + "eval.tests.test_write_extended.test_extended_row_order_and_kind[row5_full_write_accepted]", + "eval.tests.test_write_extended.test_extended_write_after_read_reuses_freed_space", + "eval.tests.test_write_extended.test_extended_write_length_matches_requested" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_full_output.test_exit_success", + "eval.tests.test_full_output.test_final_done_marker", + "eval.tests.test_full_output.test_full_output_matches_golden", + "eval.tests.test_full_output.test_no_test_failed_records", + "eval.tests.test_full_output.test_section_headers_present_in_order", + "eval.tests.test_full_output.test_stderr_is_empty", + "eval.tests.test_move.test_move_block_all_as_expected", + "eval.tests.test_move.test_move_caps_at_dest_free_space", + "eval.tests.test_move.test_move_content_column", + "eval.tests.test_move.test_move_exact_fit", + "eval.tests.test_move.test_move_operation[move_idx_00]", + "eval.tests.test_move.test_move_operation[move_idx_01]", + "eval.tests.test_move.test_move_operation[move_idx_02]", + "eval.tests.test_move.test_move_src_larger_than_dest_caps", + "eval.tests.test_overwrite.test_overwrite_all_results_as_expected", + "eval.tests.test_overwrite.test_overwrite_content_column", + "eval.tests.test_overwrite.test_overwrite_full_stability_sequence", + "eval.tests.test_overwrite.test_overwrite_length_column", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_00]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_01]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_02]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_03]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_04]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_05]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_06]", + "eval.tests.test_overwrite.test_overwrite_operation[overwrite_idx_07]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_main_golden.test_all_rw_checks_reported_as_expected", + "eval.tests.test_main_golden.test_completes_within_bounded_time", + "eval.tests.test_main_golden.test_demo_completes_with_done", + "eval.tests.test_main_golden.test_every_showcase_line_reports_expected", + "eval.tests.test_main_golden.test_exit_0_implies_nonempty_known_report", + "eval.tests.test_main_golden.test_expected_line_present[line00]", + "eval.tests.test_main_golden.test_expected_line_present[line01]", + "eval.tests.test_main_golden.test_expected_line_present[line02]", + "eval.tests.test_main_golden.test_expected_line_present[line03]", + "eval.tests.test_main_golden.test_expected_line_present[line04]", + "eval.tests.test_main_golden.test_expected_line_present[line05]", + "eval.tests.test_main_golden.test_expected_line_present[line06]", + "eval.tests.test_main_golden.test_expected_line_present[line07]", + "eval.tests.test_main_golden.test_expected_line_present[line08]", + "eval.tests.test_main_golden.test_expected_line_present[line09]", + "eval.tests.test_main_golden.test_expected_line_present[line10]", + "eval.tests.test_main_golden.test_expected_line_present[line11]", + "eval.tests.test_main_golden.test_expected_line_present[line12]", + "eval.tests.test_main_golden.test_expected_line_present[line13]", + "eval.tests.test_main_golden.test_expected_line_present[line14]", + "eval.tests.test_main_golden.test_expected_line_present[line15]", + "eval.tests.test_main_golden.test_expected_line_present[line16]", + "eval.tests.test_main_golden.test_expected_line_present[line17]", + "eval.tests.test_main_golden.test_expected_line_present[line18]", + "eval.tests.test_main_golden.test_expected_line_present[line19]", + "eval.tests.test_main_golden.test_expected_line_present[line20]", + "eval.tests.test_main_golden.test_expected_line_present[line21]", + "eval.tests.test_main_golden.test_expected_line_present[line22]", + "eval.tests.test_main_golden.test_expected_line_present[line23]", + "eval.tests.test_main_golden.test_expected_line_present[line24]", + "eval.tests.test_main_golden.test_expected_line_present[line25]", + "eval.tests.test_main_golden.test_expected_line_present[line26]", + "eval.tests.test_main_golden.test_expected_line_present[line27]", + "eval.tests.test_main_golden.test_expected_line_present[line28]", + "eval.tests.test_main_golden.test_expected_line_present[line29]", + "eval.tests.test_main_golden.test_expected_line_present[line30]", + "eval.tests.test_main_golden.test_expected_line_present[line31]", + "eval.tests.test_main_golden.test_expected_line_present[line32]", + "eval.tests.test_main_golden.test_expected_line_present[line33]", + "eval.tests.test_main_golden.test_expected_line_present[line34]", + "eval.tests.test_main_golden.test_expected_line_present[line35]", + "eval.tests.test_main_golden.test_expected_line_present[line36]", + "eval.tests.test_main_golden.test_expected_line_present[line37]", + "eval.tests.test_main_golden.test_expected_line_present[line38]", + "eval.tests.test_main_golden.test_expected_output_byte_length", + "eval.tests.test_main_golden.test_extended_write_all_fails_once_then_succeeds", + "eval.tests.test_main_golden.test_find_needle_appears_expected_times[123-4]", + "eval.tests.test_main_golden.test_find_needle_appears_expected_times[456-2]", + "eval.tests.test_main_golden.test_find_needle_appears_expected_times[678-1]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find0]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find1]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find2]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find3]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find4]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find5]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find6]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find7]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find8]", + "eval.tests.test_main_golden.test_find_reports_expected_index[find9]", + "eval.tests.test_main_golden.test_find_section_has_ten_exact_lines", + "eval.tests.test_main_golden.test_full_stdout_matches_golden_byte_for_byte", + "eval.tests.test_main_golden.test_line_at_exact_position[pos00]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos01]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos02]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos03]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos04]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos05]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos06]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos07]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos08]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos09]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos10]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos11]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos12]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos13]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos14]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos15]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos16]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos17]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos18]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos19]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos20]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos21]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos22]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos23]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos24]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos25]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos26]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos27]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos28]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos29]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos30]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos31]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos32]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos33]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos34]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos35]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos36]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos37]", + "eval.tests.test_main_golden.test_line_at_exact_position[pos38]", + "eval.tests.test_main_golden.test_move_appends_to_existing_dest_data", + "eval.tests.test_main_golden.test_move_copies_whole_source_into_empty_dest", + "eval.tests.test_main_golden.test_move_is_bounded_by_dest_capacity", + "eval.tests.test_main_golden.test_no_event_callback_marker_emitted", + "eval.tests.test_main_golden.test_no_internal_check_failure_marker[Test failed on line]", + "eval.tests.test_main_golden.test_no_internal_check_failure_marker[as_expected: 0]", + "eval.tests.test_main_golden.test_no_internal_check_failure_marker[as_expected:0]", + "eval.tests.test_main_golden.test_no_internal_check_failure_marker[test failed]", + "eval.tests.test_main_golden.test_output_is_invariant_to_invocation_mode[no-args-no-stdin]", + "eval.tests.test_main_golden.test_output_is_invariant_to_invocation_mode[with-cli-args]", + "eval.tests.test_main_golden.test_output_is_invariant_to_invocation_mode[with-stdin]", + "eval.tests.test_main_golden.test_overwrite_content_transition[abcdef01]", + "eval.tests.test_main_golden.test_overwrite_content_transition[abcdef0]", + "eval.tests.test_main_golden.test_overwrite_content_transition[abcdef]", + "eval.tests.test_main_golden.test_overwrite_content_transition[bcdef012]", + "eval.tests.test_main_golden.test_overwrite_content_transition[cdef0123]", + "eval.tests.test_main_golden.test_overwrite_content_transition[def01234]", + "eval.tests.test_main_golden.test_overwrite_content_transition[ef012345]", + "eval.tests.test_main_golden.test_overwrite_content_transition[tructure]", + "eval.tests.test_main_golden.test_overwrite_grow_lengths[after-first]", + "eval.tests.test_main_golden.test_overwrite_grow_lengths[after-second]", + "eval.tests.test_main_golden.test_overwrite_grow_lengths[after-third]", + "eval.tests.test_main_golden.test_overwrite_large_write_keeps_tail_of_structure", + "eval.tests.test_main_golden.test_overwrite_wraps_and_drops_oldest_byte", + "eval.tests.test_main_golden.test_peek_section_reports_no_failure", + "eval.tests.test_main_golden.test_repeated_invocations_identical", + "eval.tests.test_main_golden.test_report_has_expected_nonempty_line_count", + "eval.tests.test_main_golden.test_section_header_present_once[Find test]", + "eval.tests.test_main_golden.test_section_header_present_once[Move test]", + "eval.tests.test_main_golden.test_section_header_present_once[Overwrite test]", + "eval.tests.test_main_golden.test_section_header_present_once[Peek test]", + "eval.tests.test_main_golden.test_section_header_present_once[Read/Write extended test]", + "eval.tests.test_main_golden.test_section_header_present_once[Read/Write test]", + "eval.tests.test_main_golden.test_sections_appear_in_documented_order", + "eval.tests.test_main_golden.test_stderr_is_empty", + "eval.tests.test_main_golden.test_success_exit_code", + "eval.tests.test_main_golden.test_uses_crlf_line_endings" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_numeric_coherence.test_find_index_within_content_bounds", + "reasons": [ + { + "id": "if_else_both_assert", + "message": "pytest test asserts different outcomes in both if and else branches", + "path": "eval/tests/test_numeric_coherence.py", + "repair_hint": "Remove nondeterministic branching and assert one deterministic expected behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_character_domain.test_find_patterns_are_digit_runs", + "eval.tests.test_character_domain.test_move_dest_contents_are_alphanumeric_runs[move_alphabet_0]", + "eval.tests.test_character_domain.test_move_dest_contents_are_alphanumeric_runs[move_alphabet_1]", + "eval.tests.test_character_domain.test_move_dest_contents_are_alphanumeric_runs[move_alphabet_2]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_0]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_1]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_2]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_3]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_4]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_5]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_6]", + "eval.tests.test_character_domain.test_overwrite_contents_are_lowercase_digit_runs[over_alphabet_7]", + "eval.tests.test_character_domain.test_payload_fields_are_never_empty", + "eval.tests.test_character_domain.test_raw_stream_has_only_printable_plus_crlf_bytes", + "eval.tests.test_character_domain.test_raw_stream_is_valid_utf8_text", + "eval.tests.test_data_provenance.test_extended_full_flags_exact_recovery_sequence", + "eval.tests.test_data_provenance.test_extended_full_rejected_write_recovers_after_read", + "eval.tests.test_data_provenance.test_extended_partial_read_advances_only_read_pointer", + "eval.tests.test_data_provenance.test_extended_write_all_length_stays_seven_under_partial_read", + "eval.tests.test_data_provenance.test_move_dest_contents_pairwise_distinct", + "eval.tests.test_data_provenance.test_move_first_dest_is_source_payload_verbatim", + "eval.tests.test_data_provenance.test_move_second_dest_is_clamped_source_prefix", + "eval.tests.test_data_provenance.test_move_third_dest_concatenates_existing_dest_with_source_prefix", + "eval.tests.test_find.test_find_all_as_expected", + "eval.tests.test_find.test_find_found_matches_are_contiguous_run", + "eval.tests.test_find.test_find_fully_wrapped_at_8_overflow", + "eval.tests.test_find.test_find_fully_wrapped_middle", + "eval.tests.test_find.test_find_fully_wrapped_offset_blocks", + "eval.tests.test_find.test_find_linear_middle_pattern", + "eval.tests.test_find.test_find_linear_prefix_at_zero", + "eval.tests.test_find.test_find_offset_past_match_not_found", + "eval.tests.test_find.test_find_suffix_pattern", + "eval.tests.test_find.test_find_ten_records", + "eval.tests.test_find.test_find_wrapped_at_6_finds_middle", + "eval.tests.test_find.test_find_wrapped_at_6_finds_prefix", + "eval.tests.test_find.test_find_wrapped_offset_blocks_earlier_match", + "eval.tests.test_golden_report.test_full_report_crlf_preserved", + "eval.tests.test_golden_report.test_full_report_matches_golden", + "eval.tests.test_golden_report.test_section_matches_golden[find]", + "eval.tests.test_golden_report.test_section_matches_golden[move]", + "eval.tests.test_golden_report.test_section_matches_golden[overwrite]", + "eval.tests.test_golden_report.test_section_matches_golden[peek]", + "eval.tests.test_golden_report.test_section_matches_golden[read_write]", + "eval.tests.test_golden_report.test_section_matches_golden[read_write_extended]", + "eval.tests.test_move.test_move_16_into_8_clamps_to_capacity", + "eval.tests.test_move.test_move_all_as_expected", + "eval.tests.test_move.test_move_over_existing_content_offsets_source", + "eval.tests.test_move.test_move_sequence_increasing_dest_fill", + "eval.tests.test_move.test_move_small_fits_entirely", + "eval.tests.test_move.test_move_three_records", + "eval.tests.test_move.test_move_transferred_length_never_exceeds_dest", + "eval.tests.test_numeric_coherence.test_ext_full_words_are_read_write_only", + "eval.tests.test_numeric_coherence.test_ext_move_len_is_always_seven", + "eval.tests.test_numeric_coherence.test_find_index_within_content_bounds", + "eval.tests.test_numeric_coherence.test_find_not_found_reports_index_zero[find_notfound_2]", + "eval.tests.test_numeric_coherence.test_find_not_found_reports_index_zero[find_notfound_6]", + "eval.tests.test_numeric_coherence.test_find_not_found_reports_index_zero[find_notfound_9]", + "eval.tests.test_numeric_coherence.test_move_reported_len_matches_dest_content[move_len_0]", + "eval.tests.test_numeric_coherence.test_move_reported_len_matches_dest_content[move_len_1]", + "eval.tests.test_numeric_coherence.test_move_reported_len_matches_dest_content[move_len_2]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_0]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_1]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_2]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_3]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_4]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_5]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_6]", + "eval.tests.test_numeric_coherence.test_overwrite_reported_len_matches_content[over_len_7]", + "eval.tests.test_numeric_coherence.test_rw_move_len_is_always_three", + "eval.tests.test_numeric_coherence.test_rw_occupied_closes_mod_size[rw_occupied_0_3]", + "eval.tests.test_numeric_coherence.test_rw_occupied_closes_mod_size[rw_occupied_1_6]", + "eval.tests.test_numeric_coherence.test_rw_occupied_closes_mod_size[rw_occupied_2_3]", + "eval.tests.test_numeric_coherence.test_rw_occupied_closes_mod_size[rw_occupied_3_0]", + "eval.tests.test_numeric_coherence.test_rw_occupied_closes_mod_size[rw_occupied_4_3]", + "eval.tests.test_numeric_coherence.test_section_flags_are_binary[find_flags]", + "eval.tests.test_numeric_coherence.test_section_flags_are_binary[move_flags]", + "eval.tests.test_numeric_coherence.test_section_flags_are_binary[overwrite_flags]", + "eval.tests.test_numeric_coherence.test_section_flags_are_binary[read_write_extended_flags]", + "eval.tests.test_numeric_coherence.test_section_flags_are_binary[read_write_flags]", + "eval.tests.test_numeric_coherence.test_section_lengths_within_usable_capacity[find_lens]", + "eval.tests.test_numeric_coherence.test_section_lengths_within_usable_capacity[move_lens]", + "eval.tests.test_numeric_coherence.test_section_lengths_within_usable_capacity[overwrite_lens]", + "eval.tests.test_numeric_coherence.test_section_lengths_within_usable_capacity[read_write_extended_lens]", + "eval.tests.test_numeric_coherence.test_section_lengths_within_usable_capacity[read_write_lens]", + "eval.tests.test_numeric_coherence.test_sections_partition_the_report", + "eval.tests.test_overwrite.test_oversized_content_is_tail_of_source", + "eval.tests.test_overwrite.test_overwrite_all_as_expected", + "eval.tests.test_overwrite.test_overwrite_append_before_full", + "eval.tests.test_overwrite.test_overwrite_continuous_rotation", + "eval.tests.test_overwrite.test_overwrite_drops_oldest_when_full", + "eval.tests.test_overwrite.test_overwrite_eight_records", + "eval.tests.test_overwrite.test_overwrite_initial_abcdef_6", + "eval.tests.test_overwrite.test_overwrite_lengths_are_monotonic_up_to_capacity", + "eval.tests.test_overwrite.test_overwrite_oversized_keeps_tail", + "eval.tests.test_peek_and_integrity.test_every_record_line_has_expected_flag", + "eval.tests.test_peek_and_integrity.test_full_section_order_integrity", + "eval.tests.test_peek_and_integrity.test_no_failure_lines_printed", + "eval.tests.test_peek_and_integrity.test_peek_after_read_section_marker", + "eval.tests.test_peek_and_integrity.test_peek_invariants_hold_implied_by_exit_zero", + "eval.tests.test_peek_and_integrity.test_peek_marker_precedes_done", + "eval.tests.test_peek_and_integrity.test_peek_marker_present", + "eval.tests.test_peek_and_integrity.test_record_count_total", + "eval.tests.test_peek_and_integrity.test_sum_of_reported_lengths_positive", + "eval.tests.test_peek_contracts.test_peek_group_is_last_section_before_done", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[after_read8_peek_2_of_6]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[after_read8_peek_8]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[after_read8_peek_past_end]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[full_read_8_at_0]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[null_buffer_guard]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[null_data_guard]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[offset_3_size_5]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[offset_5_size_5_clamped]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[offset_equal_capacity]", + "eval.tests.test_peek_contracts.test_peek_scenario_passes_cleanly[zero_length_request]", + "eval.tests.test_peek_contracts.test_peek_section_has_no_failure_diagnostics", + "eval.tests.test_peek_contracts.test_peek_section_is_exactly_two_adjacent_lines", + "eval.tests.test_process_and_structure.test_all_section_headers_present", + "eval.tests.test_process_and_structure.test_crlf_line_termination", + "eval.tests.test_process_and_structure.test_done_marker_last_line", + "eval.tests.test_process_and_structure.test_exit_status_zero", + "eval.tests.test_process_and_structure.test_no_lf_only_line_breaks", + "eval.tests.test_process_and_structure.test_no_stderr_output", + "eval.tests.test_process_and_structure.test_section_boundary_blank_lines", + "eval.tests.test_process_and_structure.test_stdout_nonempty", + "eval.tests.test_process_robustness.test_argv_and_stdin_are_ignored[dashdash_arg]", + "eval.tests.test_process_robustness.test_argv_and_stdin_are_ignored[junk_args]", + "eval.tests.test_process_robustness.test_argv_and_stdin_are_ignored[junk_stdin]", + "eval.tests.test_process_robustness.test_argv_and_stdin_are_ignored[many_junk_args]", + "eval.tests.test_process_robustness.test_argv_and_stdin_are_ignored[no_args_empty_stdin]", + "eval.tests.test_process_robustness.test_cwd_does_not_change_output", + "eval.tests.test_process_robustness.test_output_deterministic_across_runs", + "eval.tests.test_process_robustness.test_output_is_printable_ascii", + "eval.tests.test_process_robustness.test_stdout_ends_with_crlf_done", + "eval.tests.test_process_robustness.test_stdout_has_reference_length", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l0]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l10]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l11]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l12]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l13]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l14]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l15]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l16]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l17]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l18]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l19]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l1]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l20]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l21]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l22]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l23]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l24]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l25]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l26]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l27]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l28]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l29]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l2]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l30]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l31]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l32]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l33]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l34]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l35]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l36]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l37]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l38]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l3]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l4]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l5]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l6]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l7]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l8]", + "eval.tests.test_raw_crlf_lines.test_raw_line_crlf_fragment[crlf_l9]", + "eval.tests.test_raw_crlf_lines.test_raw_sections_appear_in_order", + "eval.tests.test_raw_crlf_lines.test_raw_stream_has_all_39_crlf_lines", + "eval.tests.test_read_write_core.test_rw_all_expected_flags_set", + "eval.tests.test_read_write_core.test_rw_oversized_read_clamped_to_available", + "eval.tests.test_read_write_core.test_rw_read_advances_rptr", + "eval.tests.test_read_write_core.test_rw_read_pointer_never_exceeds_write_pointer_index", + "eval.tests.test_read_write_core.test_rw_record_set", + "eval.tests.test_read_write_core.test_rw_second_write_advances_wptr_to_6", + "eval.tests.test_read_write_core.test_rw_write_lengths_all_three", + "eval.tests.test_read_write_core.test_rw_write_of_3_advances_wptr", + "eval.tests.test_read_write_core.test_rw_write_wraps_write_pointer_to_zero", + "eval.tests.test_read_write_extended.test_ex_all_as_expected", + "eval.tests.test_read_write_extended.test_ex_first_write_all_7", + "eval.tests.test_read_write_extended.test_ex_full_read_flag_reports_success", + "eval.tests.test_read_write_extended.test_ex_full_write_flag_reports_failure_when_full", + "eval.tests.test_read_write_extended.test_ex_full_write_succeeds_after_read", + "eval.tests.test_read_write_extended.test_ex_read_3_out_of_7", + "eval.tests.test_read_write_extended.test_ex_read_frees_space_and_succeeds", + "eval.tests.test_read_write_extended.test_ex_three_records", + "eval.tests.test_ring_invariants.test_ring_invariant[ex_first_write_all]", + "eval.tests.test_ring_invariants.test_ring_invariant[ex_full_flags_expected]", + "eval.tests.test_ring_invariants.test_ring_invariant[ex_full_write_rejected_when_full]", + "eval.tests.test_ring_invariants.test_ring_invariant[ex_read_all_partial]", + "eval.tests.test_ring_invariants.test_ring_invariant[ex_read_then_write_recovery]", + "eval.tests.test_ring_invariants.test_ring_invariant[failure_free_report]", + "eval.tests.test_ring_invariants.test_ring_invariant[find_all_expected]", + "eval.tests.test_ring_invariants.test_ring_invariant[find_pattern_len_report]", + "eval.tests.test_ring_invariants.test_ring_invariant[find_start_offset_blocks_earlier]", + "eval.tests.test_ring_invariants.test_ring_invariant[find_wrap_orientations]", + "eval.tests.test_ring_invariants.test_ring_invariant[move_appends_after_existing]", + "eval.tests.test_ring_invariants.test_ring_invariant[move_never_exceeds_usable_capacity]", + "eval.tests.test_ring_invariants.test_ring_invariant[move_partial_clamp]", + "eval.tests.test_ring_invariants.test_ring_invariant[overwrite_grows_to_capacity]", + "eval.tests.test_ring_invariants.test_ring_invariant[overwrite_oversized_keeps_oldest_8]", + "eval.tests.test_ring_invariants.test_ring_invariant[overwrite_rotation_is_shift]", + "eval.tests.test_ring_invariants.test_ring_invariant[report_section_headers_exactly_once]", + "eval.tests.test_ring_invariants.test_ring_invariant[rw_all_expected]", + "eval.tests.test_ring_invariants.test_ring_invariant[rw_clamped_read_len]", + "eval.tests.test_ring_invariants.test_ring_invariant[rw_len_is_3]", + "eval.tests.test_ring_invariants.test_ring_invariant[rw_occupied_delta_preserved]", + "eval.tests.test_ring_invariants.test_ring_invariant[rw_ptr_monotonic_then_wrap]", + "eval.tests.test_spec_lines.test_report_line_exact[l0_Read_Write]", + "eval.tests.test_spec_lines.test_report_line_exact[l10_RW]", + "eval.tests.test_spec_lines.test_report_line_exact[l11_RW]", + "eval.tests.test_spec_lines.test_report_line_exact[l12_RW]", + "eval.tests.test_spec_lines.test_report_line_exact[l13_Overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l14_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l15_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l16_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l17_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l18_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l19_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l1_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l20_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l21_overwrite]", + "eval.tests.test_spec_lines.test_report_line_exact[l22_Move]", + "eval.tests.test_spec_lines.test_report_line_exact[l23_move]", + "eval.tests.test_spec_lines.test_report_line_exact[l24_move]", + "eval.tests.test_spec_lines.test_report_line_exact[l25_move]", + "eval.tests.test_spec_lines.test_report_line_exact[l26_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l27_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l28_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l29_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l2_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l30_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l31_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l32_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l33_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l34_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l35_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l36_Find]", + "eval.tests.test_spec_lines.test_report_line_exact[l37_Peek]", + "eval.tests.test_spec_lines.test_report_line_exact[l38_Done!]", + "eval.tests.test_spec_lines.test_report_line_exact[l3_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l4_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l5_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l6_Read_Write]", + "eval.tests.test_spec_lines.test_report_line_exact[l7_W]", + "eval.tests.test_spec_lines.test_report_line_exact[l8_RW]", + "eval.tests.test_spec_lines.test_report_line_exact[l9_W]" + ] + } + }, + "commit": "eb958194b81b5344a58b6fa19965edc6ccb42dd2", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.2624510897304293, + "eval_clean_hashes": [ + "277819d1813307e1079d4891516abcb89523ded3216433e8a1b10482648c2200" + ], + "input_record": { + "commit": "eb958194b81b5344a58b6fa19965edc6ccb42dd2", + "commits": 376, + "contributors": 13, + "difficulty": "easy", + "difficulty_code_lines": 1830, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1830, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.2624510897304293, + "difficulty_test_code_lines": 540, + "full_name": "MaJerle/lwrb", + "github_stars": 1514, + "input_joern_zip": "c_joern/MaJerle__lwrb.zip", + "joern_status": true, + "joern_time": 10.097813427913934, + "language": "c", + "pb_match": [ + { + "pb_fullname": "sqlite/sqlite", + "rank": 364, + "similarity": 0.44365599751472473 + }, + { + "pb_fullname": "facebook/zstd", + "rank": 786, + "similarity": 0.4629601240158081 + }, + { + "pb_fullname": "zevv/duc", + "rank": 788, + "similarity": 0.44602304697036743 + }, + { + "pb_fullname": "xorg62/tty-clock", + "rank": 849, + "similarity": 0.375108003616333 + } + ], + "repo_age": 7.56, + "repo_path": "c/MaJerle__lwrb", + "source": "commit:eb958194b81b5344a58b6fa19965edc6ccb42dd2", + "status": "done", + "url": "https://github.com/MaJerle/lwrb" + }, + "instance_id": "MaJerle__lwrb.eb95819", + "language": "c", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "MaJerle/lwrb" +} diff --git a/majerle--lwrb.eb95819/tests/test.sh b/majerle--lwrb.eb95819/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/majerle--lwrb.eb95819/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/majerle--lwrb.eb95819/tests/workspace.tar.gz b/majerle--lwrb.eb95819/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..607f01c49d647339187526412096d71a0a0e7203 --- /dev/null +++ b/majerle--lwrb.eb95819/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99031f6f1e069efe0f9e2fd02e44df3effbe23affe6be8af2ad3a14ce46dc2fb +size 4992 diff --git a/malus-security--iextractor.d9d8b/environment/Dockerfile b/malus-security--iextractor.d9d8b/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/malus-security--iextractor.d9d8b/environment/docker-compose.yaml b/malus-security--iextractor.d9d8b/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/malus-security--iextractor.d9d8b/environment/download.sh b/malus-security--iextractor.d9d8b/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..883a27261a12a1f117a1216402a49c9d7a2b96c2 --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/download.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# download.sh for iExtractor - selected target: tools/lzssdec/lzssdec +# +# The selected target (lzssdec) is a single-translation-unit C++ program that +# compiles with the base g++ toolchain and links only against the standard C++ +# runtime. It has no external library, header, or package dependencies, so this +# script performs NO compilation, linking, building, testing, or packaging. It +# only verifies the required toolchain components are present; there is nothing +# to download or prefetch, so no caches are filled and no environment variables +# need to be exported. +# +# All dependency information is embedded here directly; this script does not +# read any repository build or manifest file (no Makefile, no source file). +# +# This script is sourced (`source /source_ro/download.sh`), so it must remain +# valid in shell source mode: it uses no positional arguments, has no `exit` +# in normal control flow, and is safe to run repeatedly (idempotent). + +# --------------------------------------------------------------------------- +# Verify the C++ build toolchain required to build lzssdec is present. +# The ProgramGym base image provides g++ 13.3.0 and GNU Make 4.3; these +# checks surface a missing component as a real failure instead of masking it. +# The command output is captured into a variable (never echoed as a command +# invocation) and the branch is explicit. +# --------------------------------------------------------------------------- + +# C++ compiler check. +compiler_path="$(command -v g++)" +case "$compiler_path" in + "") + printf '%s\n' 'ERROR: required C++ build toolchain is not installed; the selected target cannot be compiled.' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then return 1; else exit 1; fi + ;; + *) + printf '%s\n' 'download.sh: build toolchain detected.' + ;; +esac + +# Build driver (GNU Make) check. +driver_path="$(command -v make)" +case "$driver_path" in + "") + printf '%s\n' 'ERROR: required build tool is not installed; the selected target cannot be built.' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then return 1; else exit 1; fi + ;; + *) + printf '%s\n' 'download.sh: build tool detected.' + ;; +esac + +# --------------------------------------------------------------------------- +# No dependency downloads or offline cache preparation are required for the +# selected target. No environment variables need to be exported: the build +# script uses the standard resolution that defaults to the compiler on PATH. +# --------------------------------------------------------------------------- + +printf '%s\n' 'download.sh: lzssdec has no external dependencies; nothing to download or prefetch.' diff --git a/malus-security--iextractor.d9d8b/environment/executable b/malus-security--iextractor.d9d8b/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..a5a77b5b7df849ffa92f014699ad65c2d052e465 Binary files /dev/null and b/malus-security--iextractor.d9d8b/environment/executable differ diff --git a/malus-security--iextractor.d9d8b/environment/harbor_configure_apt_mirror.sh b/malus-security--iextractor.d9d8b/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/malus-security--iextractor.d9d8b/environment/harbor_prepare_download_env.sh b/malus-security--iextractor.d9d8b/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/malus-security--iextractor.d9d8b/environment/workspace.tar.gz b/malus-security--iextractor.d9d8b/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..740fee26a16312c73a032040de5be5b55a74aabf --- /dev/null +++ b/malus-security--iextractor.d9d8b/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc8e708dc2b4e704092a84e0af8c28098102ade2ee3d6cd11c218fb3c23294a6 +size 8870 diff --git a/malus-security--iextractor.d9d8b/instruction.md b/malus-security--iextractor.d9d8b/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/malus-security--iextractor.d9d8b/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/malus-security--iextractor.d9d8b/solution/solve.sh b/malus-security--iextractor.d9d8b/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/malus-security--iextractor.d9d8b/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/malus-security--iextractor.d9d8b/task.toml b/malus-security--iextractor.d9d8b/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..25b1c12c2d925ba7601ce20c1e79917ec5cad9e1 --- /dev/null +++ b/malus-security--iextractor.d9d8b/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/malus-security--iextractor.d9d8b" +description = "Synthetic ProgramGym cleanroom reconstruction task for malus-security/iextractor" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "malus-security__iextractor.d9d8b5a" +repository = "malus-security/iextractor" +commit = "d9d8b5a27e6784a8240e63d090dca5faac4f0f6b" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.7054360465852505 +test_branches = 1 +test_count = 133 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/malus-security--iextractor.d9d8b/tests/Dockerfile b/malus-security--iextractor.d9d8b/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/malus-security--iextractor.d9d8b/tests/blobs/tests/generated_module_01.tar.gz b/malus-security--iextractor.d9d8b/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1ca7cbdb28e5cf12d55d1e20aea9d81b9c558fc8 --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f89503dab2e3974f401a36ba025d783c805faa463a51128803ce118cff88c89 +size 13728 diff --git a/malus-security--iextractor.d9d8b/tests/docker-compose.yaml b/malus-security--iextractor.d9d8b/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/malus-security--iextractor.d9d8b/tests/download.sh b/malus-security--iextractor.d9d8b/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..883a27261a12a1f117a1216402a49c9d7a2b96c2 --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/download.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# download.sh for iExtractor - selected target: tools/lzssdec/lzssdec +# +# The selected target (lzssdec) is a single-translation-unit C++ program that +# compiles with the base g++ toolchain and links only against the standard C++ +# runtime. It has no external library, header, or package dependencies, so this +# script performs NO compilation, linking, building, testing, or packaging. It +# only verifies the required toolchain components are present; there is nothing +# to download or prefetch, so no caches are filled and no environment variables +# need to be exported. +# +# All dependency information is embedded here directly; this script does not +# read any repository build or manifest file (no Makefile, no source file). +# +# This script is sourced (`source /source_ro/download.sh`), so it must remain +# valid in shell source mode: it uses no positional arguments, has no `exit` +# in normal control flow, and is safe to run repeatedly (idempotent). + +# --------------------------------------------------------------------------- +# Verify the C++ build toolchain required to build lzssdec is present. +# The ProgramGym base image provides g++ 13.3.0 and GNU Make 4.3; these +# checks surface a missing component as a real failure instead of masking it. +# The command output is captured into a variable (never echoed as a command +# invocation) and the branch is explicit. +# --------------------------------------------------------------------------- + +# C++ compiler check. +compiler_path="$(command -v g++)" +case "$compiler_path" in + "") + printf '%s\n' 'ERROR: required C++ build toolchain is not installed; the selected target cannot be compiled.' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then return 1; else exit 1; fi + ;; + *) + printf '%s\n' 'download.sh: build toolchain detected.' + ;; +esac + +# Build driver (GNU Make) check. +driver_path="$(command -v make)" +case "$driver_path" in + "") + printf '%s\n' 'ERROR: required build tool is not installed; the selected target cannot be built.' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then return 1; else exit 1; fi + ;; + *) + printf '%s\n' 'download.sh: build tool detected.' + ;; +esac + +# --------------------------------------------------------------------------- +# No dependency downloads or offline cache preparation are required for the +# selected target. No environment variables need to be exported: the build +# script uses the standard resolution that defaults to the compiler on PATH. +# --------------------------------------------------------------------------- + +printf '%s\n' 'download.sh: lzssdec has no external dependencies; nothing to download or prefetch.' diff --git a/malus-security--iextractor.d9d8b/tests/executable b/malus-security--iextractor.d9d8b/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..a5a77b5b7df849ffa92f014699ad65c2d052e465 Binary files /dev/null and b/malus-security--iextractor.d9d8b/tests/executable differ diff --git a/malus-security--iextractor.d9d8b/tests/harbor_configure_apt_mirror.sh b/malus-security--iextractor.d9d8b/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/malus-security--iextractor.d9d8b/tests/harbor_prepare_download_env.sh b/malus-security--iextractor.d9d8b/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/malus-security--iextractor.d9d8b/tests/programgym_evaluator.py b/malus-security--iextractor.d9d8b/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/malus-security--iextractor.d9d8b/tests/programgym_task.json b/malus-security--iextractor.d9d8b/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..f55ad298e5fc73d1bb2b7c620f2ddbf30f9ca3b0 --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/programgym_task.json @@ -0,0 +1,190 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_dictionary_behavior.test_copy_wraps_around_dict_buffer_edge", + "eval.tests.test_dictionary_behavior.test_crafted_streams_match_reference[\\x00\\x05\\x0f]", + "eval.tests.test_dictionary_behavior.test_crafted_streams_match_reference[\\x00\\xee\\xf0]", + "eval.tests.test_dictionary_behavior.test_crafted_streams_match_reference[\\x01A\\x00\\xfe\\xf0]", + "eval.tests.test_dictionary_behavior.test_crafted_streams_match_reference[\\x03AB\\x05\\xf0]", + "eval.tests.test_dictionary_behavior.test_crafted_streams_match_reference[\\xffABCDEFGH]", + "eval.tests.test_dictionary_behavior.test_dict_reference_offsets_within_window[head]", + "eval.tests.test_dictionary_behavior.test_dict_reference_offsets_within_window[mid]", + "eval.tests.test_dictionary_behavior.test_dict_reference_offsets_within_window[tail]", + "eval.tests.test_dictionary_behavior.test_dictionary_initialized_to_spaces", + "eval.tests.test_dictionary_behavior.test_dictionary_persists_across_flag_groups", + "eval.tests.test_dictionary_behavior.test_encoded_compressed_stream_matches_reference", + "eval.tests.test_dictionary_behavior.test_flag_byte_wraps_after_eight_bits", + "eval.tests.test_dictionary_behavior.test_flag_ordering_literal_then_match", + "eval.tests.test_dictionary_behavior.test_full_byte_of_literals", + "eval.tests.test_dictionary_behavior.test_kernelcache_like_header_payload_roundtrip", + "eval.tests.test_dictionary_behavior.test_literal_then_overlapping_copy", + "eval.tests.test_dictionary_behavior.test_literals_then_match_from_written_bytes", + "eval.tests.test_dictionary_behavior.test_match_at_dictionary_offset_4095", + "eval.tests.test_dictionary_behavior.test_max_match_length_eighteen_bytes", + "eval.tests.test_dictionary_behavior.test_min_match_length_three_bytes", + "eval.tests.test_dictionary_behavior.test_min_match_three_from_initial_spaces", + "eval.tests.test_dictionary_behavior.test_overlap_run_expands_repetition", + "eval.tests.test_dictionary_behavior.test_single_literal_roundtrip", + "eval.tests.test_dictionary_behavior.test_two_literals_then_space_copy", + "eval.tests.test_error_handling.test_deterministic_garbage_stream_does_not_crash[100]", + "eval.tests.test_error_handling.test_deterministic_garbage_stream_does_not_crash[101]", + "eval.tests.test_error_handling.test_deterministic_garbage_stream_does_not_crash[102]", + "eval.tests.test_error_handling.test_deterministic_garbage_stream_does_not_crash[103]", + "eval.tests.test_error_handling.test_deterministic_garbage_stream_does_not_crash[104]", + "eval.tests.test_error_handling.test_empty_stdin_fails_with_read_error", + "eval.tests.test_error_handling.test_malformed_flag_bytestream_deterministic", + "eval.tests.test_error_handling.test_stdout_written_despite_late_flush_on_partial_run", + "eval.tests.test_error_handling.test_truncated_match_token_is_flushed", + "eval.tests.test_error_handling.test_truncated_stream_after_flag_byte", + "eval.tests.test_error_handling.test_truncated_stream_after_literal_is_flushed", + "eval.tests.test_error_handling.test_very_long_input_without_any_flag_terminator", + "eval.tests.test_error_handling.test_whitespace_only_stream_is_processed_not_error", + "eval.tests.test_filter_roundtrip.test_alternating_runs_decompress_identically", + "eval.tests.test_filter_roundtrip.test_cross_chunk_boundary_subtle_roundtrip", + "eval.tests.test_filter_roundtrip.test_empty_encoded_stream_produces_empty_stdout", + "eval.tests.test_filter_roundtrip.test_exact_chunk_boundary_roundtrip", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[131072]", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[131073]", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[150000]", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[262144]", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[300000]", + "eval.tests.test_filter_roundtrip.test_large_streaming_roundtrip[70000]", + "eval.tests.test_filter_roundtrip.test_long_text_document_roundtrip", + "eval.tests.test_filter_roundtrip.test_maxmatch_run_decompresses_identically", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[17]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[1]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[2]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[3]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[4]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[5]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[6]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[7]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[8]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_binary_roundtrip[9]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_symbolic_roundtrip[11]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_symbolic_roundtrip[13]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_symbolic_roundtrip[19]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_symbolic_roundtrip[23]", + "eval.tests.test_filter_roundtrip.test_pseudorandom_symbolic_roundtrip[29]", + "eval.tests.test_filter_roundtrip.test_single_byte_stream", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text11]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text12]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text16]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text1_0]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text1_1]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text1_2]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text2000]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text300_0]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text300_1]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text43]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text46]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text512]", + "eval.tests.test_filter_roundtrip.test_text_and_pattern_roundtrip[text65536]", + "eval.tests.test_help_and_cli.test_combined_debug_and_offset_options_are_accepted", + "eval.tests.test_help_and_cli.test_combined_multiple_unknown_option_prints_usage", + "eval.tests.test_help_and_cli.test_dash_alone_is_positional_and_rejected", + "eval.tests.test_help_and_cli.test_debug_flag_keeps_stdout_unchanged", + "eval.tests.test_help_and_cli.test_debug_flag_writes_trace_to_stderr", + "eval.tests.test_help_and_cli.test_double_dash_is_positional_and_rejected", + "eval.tests.test_help_and_cli.test_double_debug_flag_adds_copy_dump_on_stderr", + "eval.tests.test_help_and_cli.test_help_flag_is_not_an_option", + "eval.tests.test_help_and_cli.test_missing_offset_value_is_tolerated", + "eval.tests.test_help_and_cli.test_positional_after_option_prints_usage_and_fails", + "eval.tests.test_help_and_cli.test_positional_argument_prints_usage_and_fails", + "eval.tests.test_help_and_cli.test_unknown_short_option_prints_usage_and_fails", + "eval.tests.test_offset_skip.test_negative_offset_parses_as_large_unsigned_and_skips_all", + "eval.tests.test_offset_skip.test_offset_across_chunk_plus_tail_decodes", + "eval.tests.test_offset_skip.test_offset_equal_to_eof_empty_remainder", + "eval.tests.test_offset_skip.test_offset_greater_than_one_chunk_spans_multiple_skip_reads", + "eval.tests.test_offset_skip.test_offset_inline_hexadecimal", + "eval.tests.test_offset_skip.test_offset_larger_than_stream_produces_no_output", + "eval.tests.test_offset_skip.test_offset_leading_zero_parses_octal", + "eval.tests.test_offset_skip.test_offset_plain_decimal_value", + "eval.tests.test_offset_skip.test_offset_skip_and_then_debug_stderr_only", + "eval.tests.test_offset_skip.test_offset_skip_of_partial_first_encoded_byte", + "eval.tests.test_offset_skip.test_offset_skips_header_bytes", + "eval.tests.test_offset_skip.test_offset_space_separated_matches_inline", + "eval.tests.test_offset_skip.test_offset_spanning_two_chunks_unit_alignment", + "eval.tests.test_offset_skip.test_offset_value_reads_unsigned_u32", + "eval.tests.test_offset_skip.test_offset_zero_compact_form", + "eval.tests.test_offset_skip.test_offset_zero_is_noop", + "eval.tests.test_option_combinations.test_multiple_offset_options_last_wins", + "eval.tests.test_option_combinations.test_offset_option_value_via_compact_empty", + "eval.tests.test_option_combinations.test_offset_skip_uses_fresh_dictionary_after_skip", + "eval.tests.test_option_combinations.test_offset_then_debug_order_independent", + "eval.tests.test_option_combinations.test_offset_with_attached_nonnumeric_suffix_parses_zero", + "eval.tests.test_option_combinations.test_separate_debug_flags_accumulate_trace", + "eval.tests.test_option_combinations.test_three_debug_dashes_equals_double_debug", + "eval.tests.test_streaming_boundary.test_chunk_boundary_respects_offset_skip", + "eval.tests.test_streaming_boundary.test_exact_chunk_multiple_reads_past_eof[131072]", + "eval.tests.test_streaming_boundary.test_exact_chunk_multiple_reads_past_eof[196608]", + "eval.tests.test_streaming_boundary.test_exact_chunk_multiple_reads_past_eof[65536]", + "eval.tests.test_streaming_boundary.test_one_past_chunk_multiple_exits_zero[131073]", + "eval.tests.test_streaming_boundary.test_one_past_chunk_multiple_exits_zero[65537]", + "eval.tests.test_streaming_boundary.test_stream_below_chunk_multiple_exits_zero[100]", + "eval.tests.test_streaming_boundary.test_stream_below_chunk_multiple_exits_zero[17]", + "eval.tests.test_streaming_boundary.test_stream_below_chunk_multiple_exits_zero[1]", + "eval.tests.test_streaming_boundary.test_stream_below_chunk_multiple_exits_zero[65535]", + "eval.tests.test_streaming_boundary.test_stream_below_chunk_multiple_exits_zero[9]", + "eval.tests.test_streaming_boundary.test_two_chunk_plus_tail_is_fully_decoded", + "eval.tests.test_write_error.test_multiple_large_chunks_overflow_report[10]", + "eval.tests.test_write_error.test_multiple_large_chunks_overflow_report[20]", + "eval.tests.test_write_error.test_multiple_large_chunks_overflow_report[5]", + "eval.tests.test_write_error.test_same_stream_succeeds_with_normal_stdout", + "eval.tests.test_write_error.test_small_output_does_not_trigger_write_error_on_dev_full", + "eval.tests.test_write_error.test_write_error_on_dev_full_reports_and_exits_one", + "eval.tests.test_write_error.test_write_error_on_readonly_stdout_fd" + ] + } + }, + "commit": "d9d8b5a27e6784a8240e63d090dca5faac4f0f6b", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.7054360465852505, + "eval_clean_hashes": [ + "52469ff5381cfea0f808ae33bd5d1452731e1c59ef9748d18aa2827eeb3359dd" + ], + "input_record": { + "commit": "d9d8b5a27e6784a8240e63d090dca5faac4f0f6b", + "difficulty": "easy", + "difficulty_code_lines": 5075, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 5075, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.7054360465852505, + "difficulty_test_code_lines": 0, + "full_name": "malus-security/iextractor", + "input_joern_zip": "cpp_joern/malus-security__iextractor.zip", + "joern_status": true, + "joern_time": 11.021600579144433, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "ip7z/7zip", + "rank": 858, + "similarity": 0.3754180073738098 + } + ], + "repo_path": "cpp/malus-security__iextractor", + "source": "commit:d9d8b5a27e6784a8240e63d090dca5faac4f0f6b", + "status": "done", + "url": "https://github.com/malus-security/iextractor" + }, + "instance_id": "malus-security__iextractor.d9d8b5a", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "malus-security/iextractor" +} diff --git a/malus-security--iextractor.d9d8b/tests/test.sh b/malus-security--iextractor.d9d8b/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/malus-security--iextractor.d9d8b/tests/workspace.tar.gz b/malus-security--iextractor.d9d8b/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..740fee26a16312c73a032040de5be5b55a74aabf --- /dev/null +++ b/malus-security--iextractor.d9d8b/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc8e708dc2b4e704092a84e0af8c28098102ade2ee3d6cd11c218fb3c23294a6 +size 8870 diff --git a/manhofer--line3dpp.fbbeca8/environment/Dockerfile b/manhofer--line3dpp.fbbeca8/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bcfa04437d24f8eb8652a133e82f9c25c0c57a0 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/manhofer--line3dpp.fbbeca8/environment/docker-compose.yaml b/manhofer--line3dpp.fbbeca8/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/manhofer--line3dpp.fbbeca8/environment/download.sh b/manhofer--line3dpp.fbbeca8/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5033e1d7cd53c9e5d4aa299d938b6921c9638a04 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/download.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym networked dependency-prep stage for Line3D++. +# +# This script is `source`d (via `source /source_ro/download.sh`) from a read-only +# repository mount during the download-validation stage. It installs the system +# toolchain and the -dev libraries that build.sh needs. It performs NO compile, +# configure, link, or test step. +# +# It is a completely standalone single file: it reads no repository source files +# (no CMakeLists.txt, Makefile, or any other repo manifest). Every package name +# that build.sh relies on is declared explicitly here, and it is idempotent +# (apt-get is a no-op for already-present packages). + +set -u + +# Make apt non-interactive. +export DEBIAN_FRONTEND=noninteractive + +# Refresh package lists so the install below can resolve versions. +apt-get update + +# Toolchain + libraries required by the CMake build of runLine3Dpp_vsfm: +# - build-essential / cmake / pkg-config : C/C++ toolchain +# - patchelf : sets $ORIGIN rpath on ./executable in build.sh +# - libeigen3-dev : Eigen (REQUIRED by CMakeLists.txt) +# - libopencv-dev : OpenCV 4.x meta package pulling in the matched +# core/imgproc/highgui/imgcodecs modules (and the +# opencv/cv.h compat header used by line3D.h). +# - libopencv-calib3d-dev : the calib3d headers + lib (cv::initUndistortRectifyMap +# lives in calib3d, and is called by line3D.cc). +# - libtclap-dev : tclap header-only lib used by the executables +# - libboost-system-dev / -filesystem-dev / -serialization-dev / -thread-dev : +# Boost components (REQUIRED by CMakeLists.txt) +# +# CUDA, Ceres, OpenMP and RapidJSON are optional and intentionally not required; +# build.sh configures the build with CUDA and Ceres disabled. +# +# apt-get install is idempotent: already-satisfied packages are skipped. +apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + pkg-config \ + patchelf \ + libeigen3-dev \ + libopencv-dev \ + libopencv-calib3d-dev \ + libtclap-dev \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-serialization-dev \ + libboost-thread-dev + +# Export build-configuration that build.sh relies on. build.sh disables CUDA and +# Ceres at configure time; nothing here invokes a build. +export L3DPP_BUILD_WITH_CUDA=OFF +export L3DPP_BUILD_WITH_CERES=OFF diff --git a/manhofer--line3dpp.fbbeca8/environment/executable b/manhofer--line3dpp.fbbeca8/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..43b931ab2b195b3a020751cd065b71bd7b2fb75a --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f35036f3eb43ac8d177b66c5977e2b43ebcc28759e7dfcfec0723c49bb5c421e +size 207728 diff --git a/manhofer--line3dpp.fbbeca8/environment/harbor_configure_apt_mirror.sh b/manhofer--line3dpp.fbbeca8/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/manhofer--line3dpp.fbbeca8/environment/harbor_prepare_download_env.sh b/manhofer--line3dpp.fbbeca8/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manhofer--line3dpp.fbbeca8/environment/workspace.tar.gz b/manhofer--line3dpp.fbbeca8/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ee448ba5497bc20de6e32e8aec9d1016144c01e1 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bae148f58d7ff0efe3b3143131e3bf3fd34a5acf491ae8a3aa440b0c6509c7 +size 75578 diff --git a/manhofer--line3dpp.fbbeca8/instruction.md b/manhofer--line3dpp.fbbeca8/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/manhofer--line3dpp.fbbeca8/solution/solve.sh b/manhofer--line3dpp.fbbeca8/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/manhofer--line3dpp.fbbeca8/task.toml b/manhofer--line3dpp.fbbeca8/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..16efc9677817815f630152d736f92b5bfc93435d --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/manhofer--line3dpp.fbbeca8" +description = "Synthetic ProgramGym cleanroom reconstruction task for manhofer/Line3Dpp" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "manhofer__Line3Dpp.fbbeca8" +repository = "manhofer/Line3Dpp" +commit = "fbbeca80d379b50c485aff806db472d0ae297211" +language = "cpp" +difficulty = "medium" +difficulty_score = 3.2942545386890707 +test_branches = 6 +test_count = 82 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/manhofer--line3dpp.fbbeca8/tests/Dockerfile b/manhofer--line3dpp.fbbeca8/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef45becedb352d71e0d28eefebe80e3c73de2bd3 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/Dockerfile @@ -0,0 +1,72 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build python3-pytest python3-pytest-xdist python3-coverage curl tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_01.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e32aaf21f154d09d3913f182ab95d41d053c30a1 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51544d7e87039c718360e3425296430f4691b5036cdb6fe1e68d3d15a0c8b606 +size 1901044 diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_02.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5d393f97b13b6ca37fb5386058dec9c50371a2e2 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c5a2b08366d55d70892c15a1487c5e6d4e17f5f2599752cd2435b3c088ba15e +size 4330237 diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_03.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..944f76e5979b143c849a171f1e7ab1bcc6bbfaa6 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:589ca204fac6705b9feb735b41e8c84a2168e67181b43cf780815b5effd63b7a +size 28224417 diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_04.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f43e8b243ef855a2ed1f002ca2a644c1e77c653a --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7899828d55d3d84ea9a9e268405a56f570da36b1435145a2cb8e4c91e2dd5ae +size 6110320 diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_05.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_05.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c8dc90dd9063ca85a81a0fc1c9cde4aedc42e7e5 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_05.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f4182d886586d83c312b9c4cf2d07a6d3490adccb1a170170af1f6e51f21145 +size 6423 diff --git a/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_06.tar.gz b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_06.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c27e52374ce54cdc46113ad90e2be43dc6d0e10d --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/blobs/tests/generated_module_06.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d4d571e4f3f9caf6787e1b19b15735f1bce26e9b94f9964859e9e4e29f0e9c2 +size 10516 diff --git a/manhofer--line3dpp.fbbeca8/tests/docker-compose.yaml b/manhofer--line3dpp.fbbeca8/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/manhofer--line3dpp.fbbeca8/tests/download.sh b/manhofer--line3dpp.fbbeca8/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5033e1d7cd53c9e5d4aa299d938b6921c9638a04 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/download.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym networked dependency-prep stage for Line3D++. +# +# This script is `source`d (via `source /source_ro/download.sh`) from a read-only +# repository mount during the download-validation stage. It installs the system +# toolchain and the -dev libraries that build.sh needs. It performs NO compile, +# configure, link, or test step. +# +# It is a completely standalone single file: it reads no repository source files +# (no CMakeLists.txt, Makefile, or any other repo manifest). Every package name +# that build.sh relies on is declared explicitly here, and it is idempotent +# (apt-get is a no-op for already-present packages). + +set -u + +# Make apt non-interactive. +export DEBIAN_FRONTEND=noninteractive + +# Refresh package lists so the install below can resolve versions. +apt-get update + +# Toolchain + libraries required by the CMake build of runLine3Dpp_vsfm: +# - build-essential / cmake / pkg-config : C/C++ toolchain +# - patchelf : sets $ORIGIN rpath on ./executable in build.sh +# - libeigen3-dev : Eigen (REQUIRED by CMakeLists.txt) +# - libopencv-dev : OpenCV 4.x meta package pulling in the matched +# core/imgproc/highgui/imgcodecs modules (and the +# opencv/cv.h compat header used by line3D.h). +# - libopencv-calib3d-dev : the calib3d headers + lib (cv::initUndistortRectifyMap +# lives in calib3d, and is called by line3D.cc). +# - libtclap-dev : tclap header-only lib used by the executables +# - libboost-system-dev / -filesystem-dev / -serialization-dev / -thread-dev : +# Boost components (REQUIRED by CMakeLists.txt) +# +# CUDA, Ceres, OpenMP and RapidJSON are optional and intentionally not required; +# build.sh configures the build with CUDA and Ceres disabled. +# +# apt-get install is idempotent: already-satisfied packages are skipped. +apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + pkg-config \ + patchelf \ + libeigen3-dev \ + libopencv-dev \ + libopencv-calib3d-dev \ + libtclap-dev \ + libboost-system-dev \ + libboost-filesystem-dev \ + libboost-serialization-dev \ + libboost-thread-dev + +# Export build-configuration that build.sh relies on. build.sh disables CUDA and +# Ceres at configure time; nothing here invokes a build. +export L3DPP_BUILD_WITH_CUDA=OFF +export L3DPP_BUILD_WITH_CERES=OFF diff --git a/manhofer--line3dpp.fbbeca8/tests/executable b/manhofer--line3dpp.fbbeca8/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..43b931ab2b195b3a020751cd065b71bd7b2fb75a --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f35036f3eb43ac8d177b66c5977e2b43ebcc28759e7dfcfec0723c49bb5c421e +size 207728 diff --git a/manhofer--line3dpp.fbbeca8/tests/harbor_configure_apt_mirror.sh b/manhofer--line3dpp.fbbeca8/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/manhofer--line3dpp.fbbeca8/tests/harbor_prepare_download_env.sh b/manhofer--line3dpp.fbbeca8/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manhofer--line3dpp.fbbeca8/tests/programgym_evaluator.py b/manhofer--line3dpp.fbbeca8/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/manhofer--line3dpp.fbbeca8/tests/programgym_task.json b/manhofer--line3dpp.fbbeca8/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..177269f43b113af295f2acb3d733950780bba1cf --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/programgym_task.json @@ -0,0 +1,359 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_parsing.test_h_short_flag_prints_identical_usage", + "eval.tests.test_cli_parsing.test_help_flag_prints_exact_usage_and_option_overview", + "eval.tests.test_cli_parsing.test_negative_position_clamped_not_parse_error", + "eval.tests.test_cli_parsing.test_non_numeric_int_option_rejected", + "eval.tests.test_cli_parsing.test_nvm_value_missing_errors", + "eval.tests.test_cli_parsing.test_required_nvm_file_missing_errors", + "eval.tests.test_cli_parsing.test_unknown_flag_rejected", + "eval.tests.test_cli_parsing.test_version_flag_prints_exact_version_banner", + "eval.tests.test_nvm_validation.test_empty_nvm_file_invalid", + "eval.tests.test_nvm_validation.test_garbage_nvm_count_skipped", + "eval.tests.test_nvm_validation.test_nonexistent_nvm_file_reported", + "eval.tests.test_nvm_validation.test_zero_aligned_cameras_rejected", + "eval.tests.test_pipeline_success.test_epipolar_overlap_is_clamped", + "eval.tests.test_pipeline_success.test_full_pipeline_default_output_folder", + "eval.tests.test_pipeline_success.test_full_pipeline_explicit_output_dir", + "eval.tests.test_pipeline_success.test_full_pipeline_uses_nvm_relative_image_paths" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_reconstruction_lines.test_multi_neighbor_matching_reduced_cap", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_reconstruction_lines.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_reconstruction_lines.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_reconstruction_lines.test_nonempty_reconstruction_pipeline", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_reconstruction_lines.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_reconstruction_lines.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_reconstruction_lines.test_optional_backend_fallback_diagnostics", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_reconstruction_lines.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_reconstruction_pipeline.test_reconstruction_pipeline_stdout_and_segments", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_reconstruction_pipeline.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_reconstruction_pipeline.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_reconstruction_lines.test_multi_neighbor_matching_reduced_cap", + "eval.tests.test_reconstruction_lines.test_nonempty_reconstruction_pipeline", + "eval.tests.test_reconstruction_lines.test_optional_backend_fallback_diagnostics", + "eval.tests.test_reconstruction_lines.test_reconstruction_exporter_formats", + "eval.tests.test_reconstruction_lines.test_reconstruction_segment_load_chain", + "eval.tests.test_reconstruction_lines.test_reconstruction_span_repeatable", + "eval.tests.test_reconstruction_pipeline.test_disable_load_and_store_flag", + "eval.tests.test_reconstruction_pipeline.test_nvm_file_missing_error", + "eval.tests.test_reconstruction_pipeline.test_reconstruction_pipeline_stdout_and_segments", + "eval.tests.test_reconstruction_pipeline.test_segment_store_then_load_chain", + "eval.tests.test_reconstruction_pipeline.test_zero_aligned_cameras_error" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_collinearity.test_collinearity_enabled_reaches_find_collinear", + "eval.tests.test_collinearity.test_collinearity_run_is_deterministic_across_runs", + "eval.tests.test_core_reconstruction.test_full_reconstruction_matches_golden_3d_lines", + "eval.tests.test_core_reconstruction.test_reconstruction_obj_exports_generator_geometry", + "eval.tests.test_cpu_no_ceres.test_cpu_no_ceres_reconstruction_matches_golden", + "eval.tests.test_error_branches.test_invalid_boolean_argument_parse_error", + "eval.tests.test_error_branches.test_missing_required_nvm_file_argument_parse_error", + "eval.tests.test_error_branches.test_nonexistent_nvm_file_is_rejected", + "eval.tests.test_error_branches.test_unwritable_output_folder_aborts_with_filesystem_error", + "eval.tests.test_minimal_single_line.test_minimal_single_line_reconstruction_matches_golden", + "eval.tests.test_minimal_single_line.test_one_fewer_segment_stays_empty_at_same_downscale", + "eval.tests.test_minimal_single_line.test_two_segments_per_image_yields_two_lines_matches_golden", + "eval.tests.test_segment_store_load.test_missing_segment_file_triggers_deterministic_redetection", + "eval.tests.test_segment_store_load.test_store_then_load_reuses_identical_segments_and_lines", + "eval.tests.test_zero_line_reconstruction.test_few_segments_yields_empty_reconstruction_matches_golden" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_clustering.test_bad_int_flag_value_parse_error", + "eval.tests.test_clustering.test_clustering_denser_graph_more_lines", + "eval.tests.test_clustering.test_clustering_deterministic_across_runs", + "eval.tests.test_clustering.test_clustering_empty_affinity_no_lines", + "eval.tests.test_clustering.test_clustering_reconstructs_nonempty_graph", + "eval.tests.test_clustering.test_empty_nvm_no_cameras_errors", + "eval.tests.test_clustering.test_help_flag_prints_usage", + "eval.tests.test_clustering.test_missing_nvm_file_errors", + "eval.tests.test_clustering.test_missing_required_nvm_arg_parse_error", + "eval.tests.test_clustering.test_version_flag_reports_version", + "eval.tests.test_clustering.test_visibility_filter_drops_all_low_visibility_clusters" + ] + }, + "generated_module_05": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_optimization_cli.test_ceres_bool_rejection_matches_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_optimization_cli.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_optimization_cli.test_flag_supplied_without_value_is_rejected_with_exact_diagnostic", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_optimization_cli.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_optimization_cli.test_missing_required_nvm_file_is_rejected_with_exact_diagnostic", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_optimization_cli.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_optimization_cli.test_nonexistent_nvm_file_rejected_before_any_reconstruction", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_optimization_cli.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_optimization_cli.test_sigma_a_rejection_matches_exact_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_optimization_cli.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_optimization_cli.test_bool_switches_reject_non_01_literals_with_exact_message", + "eval.tests.test_optimization_cli.test_ceres_bool_rejection_matches_exact_golden", + "eval.tests.test_optimization_cli.test_flag_supplied_without_value_is_rejected_with_exact_diagnostic", + "eval.tests.test_optimization_cli.test_help_exits_zero_and_names_module_switches_and_required_arg", + "eval.tests.test_optimization_cli.test_ignore_rest_flag_ignores_trailing_positional_arguments", + "eval.tests.test_optimization_cli.test_missing_required_nvm_file_is_rejected_with_exact_diagnostic", + "eval.tests.test_optimization_cli.test_nonexistent_nvm_file_rejected_before_any_reconstruction", + "eval.tests.test_optimization_cli.test_numeric_switches_reject_non_numeric_values_with_exact_message", + "eval.tests.test_optimization_cli.test_sigma_a_rejection_matches_exact_golden", + "eval.tests.test_optimization_cli.test_version_flag_exits_zero_and_reports_a_version_banner", + "eval.tests.test_optimization_cli.test_zero_camera_nvm_is_rejected_and_creates_output_dir" + ] + }, + "generated_module_06": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cudawrapper_inputfolder_output_derivation.test_explicit_output_overrides_input_folder", + "eval.tests.test_cudawrapper_inputfolder_output_derivation.test_input_folder_derives_default_output_dir", + "eval.tests.test_cudawrapper_inputfolder_output_derivation.test_input_folder_with_missing_nvm_creates_nothing", + "eval.tests.test_cudawrapper_reachability.test_all_numeric_options_accepted_reaches_nvm_check", + "eval.tests.test_cudawrapper_reachability.test_bad_use_cuda_bool_rejected", + "eval.tests.test_cudawrapper_reachability.test_default_output_dir_created_under_nvm_parent", + "eval.tests.test_cudawrapper_reachability.test_empty_nvm_path_errors", + "eval.tests.test_cudawrapper_reachability.test_every_non_numeric_camera_count_rejected_identically", + "eval.tests.test_cudawrapper_reachability.test_explicit_zero_cameras_rejected", + "eval.tests.test_cudawrapper_reachability.test_help_matches_exact_usage", + "eval.tests.test_cudawrapper_reachability.test_ignore_rest_separator_reaches_nvm", + "eval.tests.test_cudawrapper_reachability.test_malformed_bool_rejected", + "eval.tests.test_cudawrapper_reachability.test_malformed_float_rejected", + "eval.tests.test_cudawrapper_reachability.test_malformed_integer_rejected", + "eval.tests.test_cudawrapper_reachability.test_malformed_nvm_no_valid_cameras", + "eval.tests.test_cudawrapper_reachability.test_missing_nvm_value_parse_error", + "eval.tests.test_cudawrapper_reachability.test_missing_value_for_optional_int_arg", + "eval.tests.test_cudawrapper_reachability.test_no_args_required_missing", + "eval.tests.test_cudawrapper_reachability.test_nonexistent_nvm_creates_no_output_dir", + "eval.tests.test_cudawrapper_reachability.test_nonexistent_nvm_errors_without_outputdir", + "eval.tests.test_cudawrapper_reachability.test_short_help_identical_to_long_help", + "eval.tests.test_cudawrapper_reachability.test_unknown_flag_rejected", + "eval.tests.test_cudawrapper_reachability.test_use_cuda_accepted_reaches_nvm_check", + "eval.tests.test_cudawrapper_reachability.test_valid_cuda_switch_combo", + "eval.tests.test_cudawrapper_reachability.test_version_exact_output", + "eval.tests.test_cudawrapper_reachability.test_zero_camera_creates_constructor_data_dir", + "eval.tests.test_cudawrapper_truncated_nvm_rejection.test_truncated_nvm_without_count_line_rejected_stably" + ] + } + }, + "commit": "fbbeca80d379b50c485aff806db472d0ae297211", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 3.2942545386890707, + "eval_clean_hashes": [ + "f35036f3eb43ac8d177b66c5977e2b43ebcc28759e7dfcfec0723c49bb5c421e" + ], + "input_record": { + "commit": "fbbeca80d379b50c485aff806db472d0ae297211", + "full_name": "manhofer/Line3Dpp", + "input_joern_zip": "cpp_joern/manhofer__Line3Dpp.zip", + "joern_status": true, + "joern_time": 13.239820139016956, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "OSGeo/PROJ", + "rank": 744, + "similarity": 0.39362359046936035 + } + ], + "repo_path": "cpp/manhofer__Line3Dpp", + "source": "commit:fbbeca80d379b50c485aff806db472d0ae297211", + "status": "done", + "url": "https://github.com/manhofer/Line3Dpp" + }, + "instance_id": "manhofer__Line3Dpp.fbbeca8", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 4, + "branch_name": "generated_module_01", + "iteration_limit": 15, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 8, + "branch_name": "generated_module_02", + "iteration_limit": 15, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 9, + "branch_name": "generated_module_03", + "iteration_limit": 15, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_04", + "iteration_limit": 15, + "module_index": 4, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_05", + "iteration_limit": 15, + "module_index": 5, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 7, + "branch_name": "generated_module_06", + "iteration_limit": 15, + "module_index": 6, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "manhofer/Line3Dpp" +} diff --git a/manhofer--line3dpp.fbbeca8/tests/test.sh b/manhofer--line3dpp.fbbeca8/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/manhofer--line3dpp.fbbeca8/tests/workspace.tar.gz b/manhofer--line3dpp.fbbeca8/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ee448ba5497bc20de6e32e8aec9d1016144c01e1 --- /dev/null +++ b/manhofer--line3dpp.fbbeca8/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bae148f58d7ff0efe3b3143131e3bf3fd34a5acf491ae8a3aa440b0c6509c7 +size 75578 diff --git a/maniartech--signals.695e6ad/environment/Dockerfile b/maniartech--signals.695e6ad/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/maniartech--signals.695e6ad/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/maniartech--signals.695e6ad/environment/download.sh b/maniartech--signals.695e6ad/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ebdc279ddf399ff071dc9e25ca7f04765abecff --- /dev/null +++ b/maniartech--signals.695e6ad/environment/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maniartech/signals + +go 1.21 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/maniartech--signals.695e6ad/environment/executable b/maniartech--signals.695e6ad/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..8eed3f3a9bce986eeaad9304d54f363b87c354c4 --- /dev/null +++ b/maniartech--signals.695e6ad/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3bd0821f27e8347191d7b156d9decc2e52c2227fc8c8061e2d4ff2b4b784707 +size 2421601 diff --git a/maniartech--signals.695e6ad/environment/programgym-go.tar.gz b/maniartech--signals.695e6ad/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maniartech--signals.695e6ad/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maniartech--signals.695e6ad/environment/workspace.tar.gz b/maniartech--signals.695e6ad/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0ec971fb70bcf072843d5dfef1714d7e4ee1749b --- /dev/null +++ b/maniartech--signals.695e6ad/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8591b9993221881412fa5c30297c39c391b6bb9e3ae6b3fbe34abd2381332730 +size 228 diff --git a/maniartech--signals.695e6ad/instruction.md b/maniartech--signals.695e6ad/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/maniartech--signals.695e6ad/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/maniartech--signals.695e6ad/solution/solve.sh b/maniartech--signals.695e6ad/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/maniartech--signals.695e6ad/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/maniartech--signals.695e6ad/task.toml b/maniartech--signals.695e6ad/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e000d38af0581858a5d4bdd1b1307413c8885d2f --- /dev/null +++ b/maniartech--signals.695e6ad/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/maniartech--signals.695e6ad" +description = "Synthetic ProgramGym cleanroom reconstruction task for maniartech/signals" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "maniartech__signals.695e6ad" +repository = "maniartech/signals" +commit = "695e6addf3cce80acc11bb24ced6722d5d689baa" +language = "go" +difficulty = "easy" +difficulty_score = 0.9745116927373285 +test_branches = 4 +test_count = 127 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/maniartech--signals.695e6ad/tests/Dockerfile b/maniartech--signals.695e6ad/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_01.tar.gz b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d84fb4462735ca4b75cf5f854575e12ca8b1a439 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df3e4322c6de6851b96e5a6fc68b4e2a12086cf2cc8ab57475bdb9855a45a970 +size 4438 diff --git a/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_02.tar.gz b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9c839ffa832d4b194386fd2c8a04cd34e45d6721 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33b4ae206548b8957415977c9dc99633219158e8f362a5eaf39387b329986aa2 +size 4485 diff --git a/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_03.tar.gz b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7f19832e4f03f79daf49bb768c15afe5bfe6261a --- /dev/null +++ b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e16452278f38214eab43a346772a2aa87b0fd417be3279c48aff00f387871c87 +size 3838 diff --git a/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_04.tar.gz b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..81c03c2f2305c4c22a6633606e4531ed850e49ff --- /dev/null +++ b/maniartech--signals.695e6ad/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a74b7b5d1cdc29056d959a13fc001374bbc7f84f20c5ce269f40a7fddb7dcf10 +size 4833 diff --git a/maniartech--signals.695e6ad/tests/download.sh b/maniartech--signals.695e6ad/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ebdc279ddf399ff071dc9e25ca7f04765abecff --- /dev/null +++ b/maniartech--signals.695e6ad/tests/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maniartech/signals + +go 1.21 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/maniartech--signals.695e6ad/tests/executable b/maniartech--signals.695e6ad/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..8eed3f3a9bce986eeaad9304d54f363b87c354c4 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3bd0821f27e8347191d7b156d9decc2e52c2227fc8c8061e2d4ff2b4b784707 +size 2421601 diff --git a/maniartech--signals.695e6ad/tests/programgym-go.tar.gz b/maniartech--signals.695e6ad/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maniartech--signals.695e6ad/tests/programgym_evaluator.py b/maniartech--signals.695e6ad/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/maniartech--signals.695e6ad/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/maniartech--signals.695e6ad/tests/programgym_task.json b/maniartech--signals.695e6ad/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..e797289c379fd0ee7cdc4da81ed777a8aba6b17c --- /dev/null +++ b/maniartech--signals.695e6ad/tests/programgym_task.json @@ -0,0 +1,258 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[all_caps_sync]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[leading_whitespace_sync]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[long_sync_assign_true]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[long_version_flag]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[max_length_arg]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[no_dash_sync]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[short_single_dash]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[short_version_flag]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[sync_assign_true]", + "eval.tests.test_signals_module_01.test_additional_distinct_tokens_select_async_path[unicode_payload]", + "eval.tests.test_signals_module_01.test_async_no_arg_path_writes_nothing_to_stderr", + "eval.tests.test_signals_module_01.test_default_no_arg_selects_async_new_constructor", + "eval.tests.test_signals_module_01.test_empty_string_first_argument_selects_async_path[empty_string]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[double_dash_sync]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[free_positional]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[help_long]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[help_short]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[mixed_case_sync]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[single_dash]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[sync_prefix]", + "eval.tests.test_signals_module_01.test_non_sync_first_argument_selects_async_path[sync_with_equals]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[created_async]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[created_sync]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[deleted_async]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[deleted_sync]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[updated_async]", + "eval.tests.test_signals_module_01.test_payload_delivered_to_listener[updated_sync]", + "eval.tests.test_signals_module_01.test_sync_first_arg_ignores_trailing_arguments[empty_trailing]", + "eval.tests.test_signals_module_01.test_sync_first_arg_ignores_trailing_arguments[help_flag_trailing]", + "eval.tests.test_signals_module_01.test_sync_first_arg_ignores_trailing_arguments[one_positional]", + "eval.tests.test_signals_module_01.test_sync_first_arg_ignores_trailing_arguments[two_trailing_args]", + "eval.tests.test_signals_module_01.test_sync_flag_path_writes_nothing_to_stderr", + "eval.tests.test_signals_module_01.test_sync_flag_selects_sync_new_sync_constructor", + "eval.tests.test_signals_module_01.test_sync_not_first_position_selects_async_path[help_then_sync]", + "eval.tests.test_signals_module_01.test_sync_not_first_position_selects_async_path[positional_then_sync]", + "eval.tests.test_signals_module_01.test_sync_not_first_position_selects_async_path[sync_twice_later]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[anonymous positional word]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[bare double dash]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[bool-looking positional]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[case-variant trigger (not recognized)]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[double-dash variant (not recognized)]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[empty string positional]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[exact sync trigger]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[long flag with value]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[mode-named word positional]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[no-args default]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[non-trigger first arg then -sync -> async]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[numeric word positional]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[repeated sync trigger]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[single dash]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[single-dash single-char form]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[space-joined single arg (not a trigger)]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[sync + empty trailing arg]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[sync + many trailing args]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[sync + trailing flag]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[sync + trailing positional]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[truncated trigger (not recognized)]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[two anonymous positionals]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[two unknown words]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[unknown long flag]", + "eval.tests.test_base_signal_emission.test_arg_forms_yield_exact_canonical_emission[unknown short flag]", + "eval.tests.test_base_signal_emission.test_canonical_block_has_exactly_three_record_lines[async-mode]", + "eval.tests.test_base_signal_emission.test_canonical_block_has_exactly_three_record_lines[sync-mode]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[created-async]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[created-sync]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[deleted-async]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[deleted-sync]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[updated-async]", + "eval.tests.test_base_signal_emission.test_each_record_emitted_exactly_once_in_order[updated-sync]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[default]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[help-lookalike]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[positional]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[sync-trailing]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[sync]", + "eval.tests.test_base_signal_emission.test_emission_is_deterministic_across_runs[unknown-flag]", + "eval.tests.test_base_signal_emission.test_help_lookalikes_do_not_print_usage", + "eval.tests.test_base_signal_emission.test_long_token_argument_vector_still_yields_canonical_block", + "eval.tests.test_base_signal_emission.test_repeated_identical_invocations_are_stable_for_every_arg_class", + "eval.tests.test_base_signal_emission.test_sync_and_async_share_identical_delivery[async]", + "eval.tests.test_base_signal_emission.test_sync_and_async_share_identical_delivery[sync]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_signals_sync_cli.test_default_invocation_runs_example", + "eval.tests.test_signals_sync_cli.test_non_sync_first_argument_runs_example", + "eval.tests.test_signals_sync_cli.test_sync_binds_ids_to_events", + "eval.tests.test_signals_sync_cli.test_sync_blocks_until_listeners_complete", + "eval.tests.test_signals_sync_cli.test_sync_created_emitted_before_then_anchored", + "eval.tests.test_signals_sync_cli.test_sync_emission_deterministic", + "eval.tests.test_signals_sync_cli.test_sync_events_sequential_order", + "eval.tests.test_signals_sync_cli.test_sync_flag_only_first_argument", + "eval.tests.test_signals_sync_cli.test_sync_mode_exact_stdout", + "eval.tests.test_signals_sync_cli.test_sync_mode_exit_zero", + "eval.tests.test_signals_sync_cli.test_sync_mode_no_stderr", + "eval.tests.test_signals_sync_cli.test_sync_mode_nonzero_record_count", + "eval.tests.test_signals_sync_cli.test_sync_payload_formatting", + "eval.tests.test_signals_sync_cli.test_sync_propagates_record_payloads" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_double-dash_variant_of_-sync]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_flag_with_equals_assignment]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_long_help_flag_(no_help;_async_runs)]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_multiple_positional_values]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_numeric-looking_positional]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_prefix_-sync_followed_by_extra_text]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_repeated_-sync_token]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_short_help_flag_(no_help;_async_runs)]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_single_empty-string_argument]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_single_positional_value]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_truncated_-sync_form]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_unrecognized_double-dash_flag]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_unrecognized_single-dash_flag]", + "eval.tests.test_signals_async.TestAsyncArgReachability.test_args_parameterized[args_uppercase_case_mismatch_of_-sync]", + "eval.tests.test_signals_async.TestAsyncDefaultEmit.test_exit_zero", + "eval.tests.test_signals_async.TestAsyncDefaultEmit.test_full_stdout_exact", + "eval.tests.test_signals_async.TestAsyncDefaultEmit.test_lines_have_no_trailing_cr", + "eval.tests.test_signals_async.TestAsyncDefaultEmit.test_stderr_empty", + "eval.tests.test_signals_async.TestAsyncDefaultEmit.test_three_output_lines", + "eval.tests.test_signals_async.TestAsyncDeterminism.test_repeated_runs_identical", + "eval.tests.test_signals_async.TestAsyncDeterminism.test_three_sequential_runs_stable", + "eval.tests.test_signals_async.TestAsyncHelpBehavior.test_dash_dash_help_does_not_emit_help", + "eval.tests.test_signals_async.TestAsyncHelpBehavior.test_dash_h_does_not_emit_help", + "eval.tests.test_signals_async.TestAsyncHelpBehavior.test_help_stdout_exactly_matches_async", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_created_payload_exact", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_deleted_payload_exact", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_emit_order_created_updated_deleted", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_payload_struct_gob_format", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_record_id_field_boundary_values", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_record_name_field_text", + "eval.tests.test_signals_async.TestAsyncPerSignalDispatch.test_updated_payload_exact", + "eval.tests.test_signals_async.TestAsyncStdin.test_ignores_stdin_input", + "eval.tests.test_signals_async.TestSyncBoundary.test_exact_sync_routes_to_sync" + ] + } + }, + "commit": "695e6addf3cce80acc11bb24ced6722d5d689baa", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 0.9745116927373285, + "eval_clean_hashes": [ + "b3bd0821f27e8347191d7b156d9decc2e52c2227fc8c8061e2d4ff2b4b784707" + ], + "input_record": { + "commit": "695e6addf3cce80acc11bb24ced6722d5d689baa", + "commits": 121, + "contributors": 2, + "difficulty": "easy", + "difficulty_code_lines": 943, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 943, + "difficulty_runtime_deps": 0, + "difficulty_score": 0.9745116927373285, + "difficulty_test_code_lines": 1614, + "full_name": "maniartech/signals", + "github_stars": 331, + "input_joern_zip": "go_joern/maniartech__signals.zip", + "joern_status": true, + "joern_time": 8.29330687993206, + "language": "go", + "pb_match": [ + { + "pb_fullname": "go-critic/go-critic", + "rank": 620, + "similarity": 0.5235269665718079 + }, + { + "pb_fullname": "mgechev/revive", + "rank": 971, + "similarity": 0.5030065774917603 + }, + { + "pb_fullname": "incu6us/goimports-reviser", + "rank": 457, + "similarity": 0.5092058181762695 + }, + { + "pb_fullname": "psampaz/go-mod-outdated", + "rank": 288, + "similarity": 0.5038194060325623 + }, + { + "pb_fullname": "kisielk/errcheck", + "rank": 521, + "similarity": 0.5536677837371826 + }, + { + "pb_fullname": "tomarrell/wrapcheck", + "rank": 134, + "similarity": 0.5635902881622314 + } + ], + "repo_age": 3.73, + "repo_path": "go/maniartech__signals", + "source": "commit:695e6addf3cce80acc11bb24ced6722d5d689baa", + "status": "done", + "url": "https://github.com/maniartech/signals" + }, + "instance_id": "maniartech__signals.695e6ad", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "maniartech/signals" +} diff --git a/maniartech--signals.695e6ad/tests/test.sh b/maniartech--signals.695e6ad/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/maniartech--signals.695e6ad/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/maniartech--signals.695e6ad/tests/workspace.tar.gz b/maniartech--signals.695e6ad/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0ec971fb70bcf072843d5dfef1714d7e4ee1749b --- /dev/null +++ b/maniartech--signals.695e6ad/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8591b9993221881412fa5c30297c39c391b6bb9e3ae6b3fbe34abd2381332730 +size 228 diff --git a/manic-systems--dix.bb78117/environment/Dockerfile b/manic-systems--dix.bb78117/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/manic-systems--dix.bb78117/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/manic-systems--dix.bb78117/environment/download.sh b/manic-systems--dix.bb78117/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e5860529121af923908359c6f2eef1d332ee6315 --- /dev/null +++ b/manic-systems--dix.bb78117/environment/download.sh @@ -0,0 +1,1519 @@ +#!/usr/bin/env bash +# download.sh for the 'dix' Rust workspace (dix + dix-diff). +# +# This script is SOURCED from the (read-only) repository mount while the +# container still has network access, so it must be a standalone file: it must +# not read any repository file (Cargo.toml, Cargo.lock, src/*, ...) and it must +# generate every manifest it needs from inline heredocs. +# +# It only PREFETCHES the crate dependencies into the shared cargo cache. It +# never compiles the project (no cargo build/cargo test). The offline build +# is performed later by build.sh using the cache prepared here. +# +# It runs under `set -e` semantics for the caller but is source-safe: it uses +# only exported environment variables, takes no positional arguments, and does +# not call `exit` in normal control flow. + +# Guard against being run in a way that would break sourcing (never return in +# normal control flow). +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + : # being sourced - continue in the current shell +else + printf 'download.sh must be sourced, not executed: source %s\n' "$0" >&2 + exit 1 +fi + +# --------------------------------------------------------------------------- +# 1. Dedicated prefetch workspace (created under /tmp so we never touch the +# read-only /source_ro mount and never read its files). +# --------------------------------------------------------------------------- +DOWNLOAD_ROOT="${DOWNLOAD_ROOT:-/tmp/dix-download}" +mkdir -p "$DOWNLOAD_ROOT/src" +mkdir -p "$DOWNLOAD_ROOT/crates/dix-diff/src" + +# --------------------------------------------------------------------------- +# 2. Inline-generated workspace Cargo.toml. +# +# This mirrors the repository workspace manifest EXACTLY so that `cargo +# fetch` against it produces a byte-identical dependency set to the one the +# offline build will consume. All dependency content is written inline. +# --------------------------------------------------------------------------- +cat > "$DOWNLOAD_ROOT/Cargo.toml" <<'CARGO_TOML' +[workspace] +members = [ "crates/dix", "crates/dix-diff" ] +resolver = "3" + +[workspace.package] +categories = [ "command-line-utilities" ] +edition = "2024" +homepage = "https://github.com/faukah/dix" +keywords = [ "nix", "nixos" ] +license = "GPL-3.0-only" +repository = "https://github.com/faukah/dix" +rust-version = "1.95.0" +version = "2.1.0" + +[workspace.dependencies] +dix-diff = { path = "crates/dix-diff", version = "=2.1.0" } + +clap = { features = [ "derive" ], version = "4.5.37" } +clap-verbosity-flag = "3.0.2" +derive_more = { features = [ "full" ], version = "2.0.1" } +diff = "0.1.13" +eyre = "0.6" +itertools = "0.15.0" +pathfinding = "4.14.0" +proptest = "1.6.0" +rusqlite = { features = [ "bundled" ], version = "0.40.0" } +serde = { features = [ "derive" ], version = "1.0.228" } +serde_json = "1.0.149" +size = "0.5.0" +tempfile = "3.10.0" +tracing = "0.1" +tracing-subscriber = { features = [ "env-filter" ], version = "0.3" } +unicode-width = "0.2.0" +yansi = { features = [ "detect-env", "detect-tty" ], version = "1.0.1" } + +# The crates reference `[lints] workspace = true`, so a workspace.lints table +# is required for the manifest to parse; the exact lint content is irrelevant +# to `cargo fetch` (it is only evaluated at compile time), so a minimal table +# is used for this offline prefetch contract. +[workspace.lints.clippy] +all = "warn" + +[profile.release] +codegen-units = 1 +lto = "fat" +opt-level = 3 +CARGO_TOML + +# --------------------------------------------------------------------------- +# 3. Inline-generated per-crate manifests. These match crates/dix/Cargo.toml +# and crates/dix-diff/Cargo.toml. +# --------------------------------------------------------------------------- +mkdir -p "$DOWNLOAD_ROOT/crates/dix/src" + +cat > "$DOWNLOAD_ROOT/crates/dix/Cargo.toml" <<'CARGO_DIX' +[package] +name = "dix" +version.workspace = true +edition.workspace = true +description = "Diff Nix" +readme = "../../README.md" +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +dix-diff = { workspace = true } + +clap = { workspace = true } +clap-verbosity-flag = { workspace = true } +derive_more = { workspace = true } +diff = { workspace = true } +eyre = { workspace = true } +itertools = { workspace = true } +rusqlite = { workspace = true } +serde = { optional = true, workspace = true } +serde_json = { optional = true, workspace = true } +size = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +unicode-width = { workspace = true } +yansi = { workspace = true } + +[dev-dependencies] +proptest = { workspace = true } +tempfile = { workspace = true } + +[features] +default = [ "json" ] +json = [ "dep:serde", "dep:serde_json" ] + +[lints] +workspace = true +CARGO_DIX + +cat > "$DOWNLOAD_ROOT/crates/dix-diff/Cargo.toml" <<'CARGO_DIFF' +[package] +name = "dix-diff" +version.workspace = true +edition.workspace = true +description = "Internal pure diff engine for dix" +readme = "../../README.md" +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +derive_more = { workspace = true } +itertools = { workspace = true } +pathfinding = { workspace = true } + +[dev-dependencies] +proptest = { workspace = true } + +[features] +default = [ ] + +[lints] +workspace = true +CARGO_DIFF + +# `readme = "../../README.md"` is referenced above to satisfy the manifest even +# though we never read the repository README; provide a placeholder so cargo +# fetch / metadata resolution succeeds without touching /source_ro. +printf 'placeholder\n' > "$DOWNLOAD_ROOT/README.md" + +# Minimal stub source files so that cargo metadata/build planning can resolve +# the package target layout (names/paths) without needing any real source. +printf 'pub fn _placeholder() {}\n' > "$DOWNLOAD_ROOT/crates/dix/src/lib.rs" +printf 'fn main() {}\n' > "$DOWNLOAD_ROOT/crates/dix/src/main.rs" +printf 'pub fn _placeholder() {}\n' > "$DOWNLOAD_ROOT/crates/dix-diff/src/lib.rs" + +# --------------------------------------------------------------------------- +# 4. Inline-generated Cargo.lock. +# +# The offline build (build.sh) runs `cargo build --offline --locked` against +# the real repository, whose Cargo.lock pins exact crate versions (e.g. +# getrandom 0.4.2 -> wasip3, tempfile 3.27.0, rusqlite 0.40.1, serde_json +# 1.0.150, wasm-bindgen 0.2.122, cc 1.2.63, ...). To make the prefetched +# cache match that locked set byte-for-byte, this lockfile (an exact copy of +# the repository's Cargo.lock) is embedded here and written into the +# prefetch workspace. `cargo fetch` below then downloads precisely the +# packages the offline locked build will need. The lockfile content is +# written inline; nothing is read from the repository. +# --------------------------------------------------------------------------- +cat > "$DOWNLOAD_ROOT/Cargo.lock" <<'CARGO_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d7ced0ae9557296835c32bf1b1e02b44c746701f898460fb000d7eaa84f00a" + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "cc" +version = "1.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap-verbosity-flag" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" +dependencies = [ + "clap", + "log", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "deprecate-until" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0795c0c5b2cab72b80d75b5cb08bde679e616c67e954669a2476668319ac3a" +dependencies = [ + "proc-macro2", + "quote", + "semver", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "dix" +version = "2.1.0" +dependencies = [ + "clap", + "clap-verbosity-flag", + "derive_more", + "diff", + "dix-diff", + "eyre", + "itertools", + "proptest", + "rusqlite", + "serde", + "serde_json", + "size", + "tempfile", + "tracing", + "tracing-subscriber", + "unicode-width", + "yansi", +] + +[[package]] +name = "dix-diff" +version = "2.1.0" +dependencies = [ + "derive_more", + "itertools", + "pathfinding", + "proptest", +] + +[[package]] +name = "either" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "hashlink" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5081f264ed7adee96ea4b4778b6bb9da0a7228b084587aa3bd3ff05da7c5a3b" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libsqlite3-sys" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c19a05435c21ac299d71b6a9c13db3e3f47c520517d58990a462a1397a61db" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "log" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "113b30b4cd05f7c06868fdb2854f66a7b9fece9a48425351cd532e810d74024f" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "pathfinding" +version = "4.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835ad2773f8587ad2d90a0f7f0022ca743dfd5a6a24ea25062f3519c38d2fcfa" +dependencies = [ + "deprecate-until", + "indexmap", + "integer-sqrt", + "num-traits", + "rustc-hash", + "thiserror", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror", +] + +[[package]] +name = "rusqlite" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11438310b19e3109b6446c33d1ed5e889428cf2e278407bc7896bc4aaea43323" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "sqlite-wasm-rs", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "size" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6709c7b6754dca1311b3c73e79fcce40dd414c782c66d88e8823030093b02b" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "zerocopy" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b065d4f0e55f82fae73202e189638116a87c55ab6b8e6c2721e13dd9d854ad1" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b631b19d36a892ab55420c92dbc83ccd79274f25be714855d3074aa71cab639" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +CARGO_LOCK + +# --------------------------------------------------------------------------- +# 5. Prefetch every dependency into the shared CARGO_HOME cache. +# +# We run cargo fetch against the GENERATED manifest + embedded lockfile +# (never bare `cargo fetch` in /source_ro or the repo root, per the +# ProgramGym Rust rules), and never against the real repository's +# Cargo.toml/Cargo.lock. Because the embedded lockfile matches the +# repository lockfile exactly, the cache will contain precisely the packages +# that the offline `cargo build --offline --locked` (build.sh) needs. +# --------------------------------------------------------------------------- +export CARGO_HOME="${CARGO_HOME:-/root/.cargo}" +export CARGO_NET_OFFLINE="${CARGO_NET_OFFLINE:-false}" +export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}" + +# Fetch the exact locked dependency set. Failure is exposed explicitly (never +# masked) with the source/exec idiom. +if ! cargo fetch --manifest-path "$DOWNLOAD_ROOT/Cargo.toml" --locked; then + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# Fetch with the "json"/"default" feature graph plus dev-deps of both crates is +# already covered above. Also prefetch the release-profile build of the binary's +# resolved graph is the same set. + +printf 'download.sh: cargo dependencies prefetched into %s\n' "$CARGO_HOME" diff --git a/manic-systems--dix.bb78117/environment/executable b/manic-systems--dix.bb78117/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..52dab09cbef74622d2dce512e27af626d7458878 --- /dev/null +++ b/manic-systems--dix.bb78117/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f748639f2444e8ddefb59ff872d2e8c6afd0c63f8ad2d15ea5c752baf858f871 +size 4206824 diff --git a/manic-systems--dix.bb78117/environment/harbor_prepare_download_env.sh b/manic-systems--dix.bb78117/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/manic-systems--dix.bb78117/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manic-systems--dix.bb78117/environment/workspace.tar.gz b/manic-systems--dix.bb78117/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..200aa34aebb1eb91feadb96842ce240700ab59ba --- /dev/null +++ b/manic-systems--dix.bb78117/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:530c588bd865a8ec53b7f86a2394a50031809b47031b5a0289c6017b139f4d4a +size 4120 diff --git a/manic-systems--dix.bb78117/instruction.md b/manic-systems--dix.bb78117/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/manic-systems--dix.bb78117/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/manic-systems--dix.bb78117/solution/solve.sh b/manic-systems--dix.bb78117/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/manic-systems--dix.bb78117/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/manic-systems--dix.bb78117/task.toml b/manic-systems--dix.bb78117/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..28718dcc36ef10c67f27c56fca0c74f4f26e0672 --- /dev/null +++ b/manic-systems--dix.bb78117/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/manic-systems--dix.bb78117" +description = "Synthetic ProgramGym cleanroom reconstruction task for manic-systems/dix" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "manic-systems__dix.bb78117" +repository = "manic-systems/dix" +commit = "bb78117425dea82d840a032b594f3641f3f3b399" +language = "rust" +difficulty = "easy" +difficulty_score = 1.7019132112123438 +test_branches = 4 +test_count = 398 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/manic-systems--dix.bb78117/tests/Dockerfile b/manic-systems--dix.bb78117/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/manic-systems--dix.bb78117/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_01.tar.gz b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..46d1f56d017dff6a34130a0037c3ee4d975d0c8e --- /dev/null +++ b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c554de4e302f65e744ce490e2d51dfa90112f5cfa7ce1768e699b8014bd23d74 +size 20192 diff --git a/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_02.tar.gz b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f9dc379730edf21453e0104e69db545e9b419b15 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:139ad69453687eb5e6ab432fc441cb6f6558a2430c98f75457baed2bb48852e9 +size 19466 diff --git a/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_03.tar.gz b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b4b234ee70a71406a5768243334857388db1ccf9 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d176c782655f754a953f6d60971054707e8781b82b94f68ada5a8f7f8ff0757d +size 21836 diff --git a/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_04.tar.gz b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3443f27064786a17b3cf4e83d4b1e30cbfb0f19e --- /dev/null +++ b/manic-systems--dix.bb78117/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9883544e16eb94b9b590964f65ea49684958bd61b63c1415532f84941ccd5991 +size 15455 diff --git a/manic-systems--dix.bb78117/tests/download.sh b/manic-systems--dix.bb78117/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e5860529121af923908359c6f2eef1d332ee6315 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/download.sh @@ -0,0 +1,1519 @@ +#!/usr/bin/env bash +# download.sh for the 'dix' Rust workspace (dix + dix-diff). +# +# This script is SOURCED from the (read-only) repository mount while the +# container still has network access, so it must be a standalone file: it must +# not read any repository file (Cargo.toml, Cargo.lock, src/*, ...) and it must +# generate every manifest it needs from inline heredocs. +# +# It only PREFETCHES the crate dependencies into the shared cargo cache. It +# never compiles the project (no cargo build/cargo test). The offline build +# is performed later by build.sh using the cache prepared here. +# +# It runs under `set -e` semantics for the caller but is source-safe: it uses +# only exported environment variables, takes no positional arguments, and does +# not call `exit` in normal control flow. + +# Guard against being run in a way that would break sourcing (never return in +# normal control flow). +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + : # being sourced - continue in the current shell +else + printf 'download.sh must be sourced, not executed: source %s\n' "$0" >&2 + exit 1 +fi + +# --------------------------------------------------------------------------- +# 1. Dedicated prefetch workspace (created under /tmp so we never touch the +# read-only /source_ro mount and never read its files). +# --------------------------------------------------------------------------- +DOWNLOAD_ROOT="${DOWNLOAD_ROOT:-/tmp/dix-download}" +mkdir -p "$DOWNLOAD_ROOT/src" +mkdir -p "$DOWNLOAD_ROOT/crates/dix-diff/src" + +# --------------------------------------------------------------------------- +# 2. Inline-generated workspace Cargo.toml. +# +# This mirrors the repository workspace manifest EXACTLY so that `cargo +# fetch` against it produces a byte-identical dependency set to the one the +# offline build will consume. All dependency content is written inline. +# --------------------------------------------------------------------------- +cat > "$DOWNLOAD_ROOT/Cargo.toml" <<'CARGO_TOML' +[workspace] +members = [ "crates/dix", "crates/dix-diff" ] +resolver = "3" + +[workspace.package] +categories = [ "command-line-utilities" ] +edition = "2024" +homepage = "https://github.com/faukah/dix" +keywords = [ "nix", "nixos" ] +license = "GPL-3.0-only" +repository = "https://github.com/faukah/dix" +rust-version = "1.95.0" +version = "2.1.0" + +[workspace.dependencies] +dix-diff = { path = "crates/dix-diff", version = "=2.1.0" } + +clap = { features = [ "derive" ], version = "4.5.37" } +clap-verbosity-flag = "3.0.2" +derive_more = { features = [ "full" ], version = "2.0.1" } +diff = "0.1.13" +eyre = "0.6" +itertools = "0.15.0" +pathfinding = "4.14.0" +proptest = "1.6.0" +rusqlite = { features = [ "bundled" ], version = "0.40.0" } +serde = { features = [ "derive" ], version = "1.0.228" } +serde_json = "1.0.149" +size = "0.5.0" +tempfile = "3.10.0" +tracing = "0.1" +tracing-subscriber = { features = [ "env-filter" ], version = "0.3" } +unicode-width = "0.2.0" +yansi = { features = [ "detect-env", "detect-tty" ], version = "1.0.1" } + +# The crates reference `[lints] workspace = true`, so a workspace.lints table +# is required for the manifest to parse; the exact lint content is irrelevant +# to `cargo fetch` (it is only evaluated at compile time), so a minimal table +# is used for this offline prefetch contract. +[workspace.lints.clippy] +all = "warn" + +[profile.release] +codegen-units = 1 +lto = "fat" +opt-level = 3 +CARGO_TOML + +# --------------------------------------------------------------------------- +# 3. Inline-generated per-crate manifests. These match crates/dix/Cargo.toml +# and crates/dix-diff/Cargo.toml. +# --------------------------------------------------------------------------- +mkdir -p "$DOWNLOAD_ROOT/crates/dix/src" + +cat > "$DOWNLOAD_ROOT/crates/dix/Cargo.toml" <<'CARGO_DIX' +[package] +name = "dix" +version.workspace = true +edition.workspace = true +description = "Diff Nix" +readme = "../../README.md" +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +dix-diff = { workspace = true } + +clap = { workspace = true } +clap-verbosity-flag = { workspace = true } +derive_more = { workspace = true } +diff = { workspace = true } +eyre = { workspace = true } +itertools = { workspace = true } +rusqlite = { workspace = true } +serde = { optional = true, workspace = true } +serde_json = { optional = true, workspace = true } +size = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +unicode-width = { workspace = true } +yansi = { workspace = true } + +[dev-dependencies] +proptest = { workspace = true } +tempfile = { workspace = true } + +[features] +default = [ "json" ] +json = [ "dep:serde", "dep:serde_json" ] + +[lints] +workspace = true +CARGO_DIX + +cat > "$DOWNLOAD_ROOT/crates/dix-diff/Cargo.toml" <<'CARGO_DIFF' +[package] +name = "dix-diff" +version.workspace = true +edition.workspace = true +description = "Internal pure diff engine for dix" +readme = "../../README.md" +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +derive_more = { workspace = true } +itertools = { workspace = true } +pathfinding = { workspace = true } + +[dev-dependencies] +proptest = { workspace = true } + +[features] +default = [ ] + +[lints] +workspace = true +CARGO_DIFF + +# `readme = "../../README.md"` is referenced above to satisfy the manifest even +# though we never read the repository README; provide a placeholder so cargo +# fetch / metadata resolution succeeds without touching /source_ro. +printf 'placeholder\n' > "$DOWNLOAD_ROOT/README.md" + +# Minimal stub source files so that cargo metadata/build planning can resolve +# the package target layout (names/paths) without needing any real source. +printf 'pub fn _placeholder() {}\n' > "$DOWNLOAD_ROOT/crates/dix/src/lib.rs" +printf 'fn main() {}\n' > "$DOWNLOAD_ROOT/crates/dix/src/main.rs" +printf 'pub fn _placeholder() {}\n' > "$DOWNLOAD_ROOT/crates/dix-diff/src/lib.rs" + +# --------------------------------------------------------------------------- +# 4. Inline-generated Cargo.lock. +# +# The offline build (build.sh) runs `cargo build --offline --locked` against +# the real repository, whose Cargo.lock pins exact crate versions (e.g. +# getrandom 0.4.2 -> wasip3, tempfile 3.27.0, rusqlite 0.40.1, serde_json +# 1.0.150, wasm-bindgen 0.2.122, cc 1.2.63, ...). To make the prefetched +# cache match that locked set byte-for-byte, this lockfile (an exact copy of +# the repository's Cargo.lock) is embedded here and written into the +# prefetch workspace. `cargo fetch` below then downloads precisely the +# packages the offline locked build will need. The lockfile content is +# written inline; nothing is read from the repository. +# --------------------------------------------------------------------------- +cat > "$DOWNLOAD_ROOT/Cargo.lock" <<'CARGO_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d7ced0ae9557296835c32bf1b1e02b44c746701f898460fb000d7eaa84f00a" + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "cc" +version = "1.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556e016178bb5662a08681bbe0f00f8e17631781a4dfc8c45e466e4b185ec27f" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap-verbosity-flag" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" +dependencies = [ + "clap", + "log", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "deprecate-until" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0795c0c5b2cab72b80d75b5cb08bde679e616c67e954669a2476668319ac3a" +dependencies = [ + "proc-macro2", + "quote", + "semver", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "dix" +version = "2.1.0" +dependencies = [ + "clap", + "clap-verbosity-flag", + "derive_more", + "diff", + "dix-diff", + "eyre", + "itertools", + "proptest", + "rusqlite", + "serde", + "serde_json", + "size", + "tempfile", + "tracing", + "tracing-subscriber", + "unicode-width", + "yansi", +] + +[[package]] +name = "dix-diff" +version = "2.1.0" +dependencies = [ + "derive_more", + "itertools", + "pathfinding", + "proptest", +] + +[[package]] +name = "either" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash 0.2.0", +] + +[[package]] +name = "hashlink" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5081f264ed7adee96ea4b4778b6bb9da0a7228b084587aa3bd3ff05da7c5a3b" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libsqlite3-sys" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6c19a05435c21ac299d71b6a9c13db3e3f47c520517d58990a462a1397a61db" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "log" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "113b30b4cd05f7c06868fdb2854f66a7b9fece9a48425351cd532e810d74024f" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8" + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "pathfinding" +version = "4.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835ad2773f8587ad2d90a0f7f0022ca743dfd5a6a24ea25062f3519c38d2fcfa" +dependencies = [ + "deprecate-until", + "indexmap", + "integer-sqrt", + "num-traits", + "rustc-hash", + "thiserror", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror", +] + +[[package]] +name = "rusqlite" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11438310b19e3109b6446c33d1ed5e889428cf2e278407bc7896bc4aaea43323" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "sqlite-wasm-rs", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "size" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6709c7b6754dca1311b3c73e79fcce40dd414c782c66d88e8823030093b02b" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "zerocopy" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b065d4f0e55f82fae73202e189638116a87c55ab6b8e6c2721e13dd9d854ad1" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b631b19d36a892ab55420c92dbc83ccd79274f25be714855d3074aa71cab639" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +CARGO_LOCK + +# --------------------------------------------------------------------------- +# 5. Prefetch every dependency into the shared CARGO_HOME cache. +# +# We run cargo fetch against the GENERATED manifest + embedded lockfile +# (never bare `cargo fetch` in /source_ro or the repo root, per the +# ProgramGym Rust rules), and never against the real repository's +# Cargo.toml/Cargo.lock. Because the embedded lockfile matches the +# repository lockfile exactly, the cache will contain precisely the packages +# that the offline `cargo build --offline --locked` (build.sh) needs. +# --------------------------------------------------------------------------- +export CARGO_HOME="${CARGO_HOME:-/root/.cargo}" +export CARGO_NET_OFFLINE="${CARGO_NET_OFFLINE:-false}" +export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}" + +# Fetch the exact locked dependency set. Failure is exposed explicitly (never +# masked) with the source/exec idiom. +if ! cargo fetch --manifest-path "$DOWNLOAD_ROOT/Cargo.toml" --locked; then + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# Fetch with the "json"/"default" feature graph plus dev-deps of both crates is +# already covered above. Also prefetch the release-profile build of the binary's +# resolved graph is the same set. + +printf 'download.sh: cargo dependencies prefetched into %s\n' "$CARGO_HOME" diff --git a/manic-systems--dix.bb78117/tests/executable b/manic-systems--dix.bb78117/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..52dab09cbef74622d2dce512e27af626d7458878 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f748639f2444e8ddefb59ff872d2e8c6afd0c63f8ad2d15ea5c752baf858f871 +size 4206824 diff --git a/manic-systems--dix.bb78117/tests/harbor_prepare_download_env.sh b/manic-systems--dix.bb78117/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manic-systems--dix.bb78117/tests/programgym_evaluator.py b/manic-systems--dix.bb78117/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/manic-systems--dix.bb78117/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/manic-systems--dix.bb78117/tests/programgym_task.json b/manic-systems--dix.bb78117/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..26addd9525ac28c5e67418b67589c84b20f9c60a --- /dev/null +++ b/manic-systems--dix.bb78117/tests/programgym_task.json @@ -0,0 +1,3267 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_args.test_help_short_lists_name_and_path_arguments", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_invalid_color_value_is_a_parse_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_invalid_output_value_is_a_parse_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_no_arguments_is_a_usage_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_one_argument_reports_missing_new_path", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_all_backends_can_fail_when_command_missing", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_command_backend_display_name_in_skip_logs", + "reasons": [ + { + "detail": "AssertionError: assert 'CommandBackend' in ' INFO starting diff computation\\n<<< /tmp/pytest-of-root/pytest-2/popen-gw12/test_command_backend_display_n0/old\\n>>>...ew=100 bytes\\n\\nPATHS: 1 -> 1 (+0, -", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_db_connection_failures_are_warned", + "reasons": [ + { + "detail": "AssertionError: assert 'backend connected successfully' in ' INFO starting diff computation\\n<<< /tmp/pytest-of-root/pytest-2/popen-gw12/test_db_connection_failures_ar0/old\\n>>>...ew=100 bytes\\n\\nPATH", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_default_backend_chain_has_three_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_default_chain_uses_immutable_sqlite_backend", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_default_reports_some_backends_failed", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_force_correctness_chain_has_two_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_connection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_connection.test_quiet_suppresses_connection_info", + "reasons": [ + { + "detail": "assert 2 == 0", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_closure_query_context_wraps_path", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_command_backend_issues_both_query_kinds", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_fallback_surfaces_combined_error", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_invalid_path_in_nix_store_output_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[empty-ish]", + "reasons": [ + { + "detail": "assert 'must start with /nix/store' in \"Error: failed to query closure path info of '/tmp/pytest-of-root/pytest-2/popen-gw12/test_invalid_store_path_in_inf0/... by:\\n missing NAR size in nix path-info", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[short-hash]", + "reasons": [ + { + "detail": "assert 0 == 1", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_non_numeric_size_is_rejected", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_nonzero_nix_store_exit_is_an_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_path_info_unparsable_blank_line_is_ignored_only_when_blank", + "reasons": [ + { + "detail": "assert 1 == 0", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_selection_char_in_human_output", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_single_identical_path_closure", + "reasons": [ + { + "detail": "AssertionError: assert {'old': 1, 'n... 'removed': 0} == {'old': 1, 'n... 'removed': 1} Omitting 2 identical items, use -vv to show Differing items: {'added': 0} != {'added': 1} {'removed': 0} != {'re", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_queries.test_versionless_name_uses_placeholder", + "reasons": [ + { + "detail": "AssertionError: assert 'somename' in '<<< /tmp/pytest-of-root/pytest-2/popen-gw7/test_versionless_name_uses_pla0/old\\n>>> /tmp/pytest-of-root/pytest-2/popen-gw7/test_versionless_name_uses_pla0/new\\n\\n", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_queries.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_selection.test_selection_selected_in_human_marker", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_selection.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_selection.test_sizes_aggregate_across_packages", + "reasons": [ + { + "detail": "AssertionError: assert {'b'} == {'a', 'b'} Extra items in the right set: 'a' Full diff: { - 'a', 'b', }", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_selection.test_unselected_has_no_marker_in_human", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_selection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_selection.test_version_changed_old_superseded_by_new", + "reasons": [ + { + "detail": "StopIteration", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_sqlite_db.test_sqlite_db_absent_still_falls_to_command", + "reasons": [ + { + "id": "try_except_swallow", + "message": "pytest test swallows exceptions in an except handler", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Do not swallow exceptions; let pytest fail or assert the exact expected exception.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_sqlite_db.test_sqlite_store_nonempty_sqlite_skips_command_backend", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_sqlite_db.test_sqlite_store_versionless_names_render_placeholder", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_sqlite_db.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_trace.test_backend_count_reported_across_verbosities[-v]", + "reasons": [ + { + "detail": "assert 'connected_count=1 total_count=3' in '<<< /tmp/pytest-of-root/pytest-2/popen-gw5/test_backend_count_reported_ac0/old\\n>>> /tmp/pytest-of-root/pytest-2/pope...ackend_count_reported_ac0/new\": not", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_store_trace.test_default_chain_registers_three_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_trace.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_trace.test_force_correctness_chain_has_two_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_trace.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_trace.test_some_backends_failed_warning_in_default_chain", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_trace.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_trace.test_sqlite_backend_display_in_skip_log", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_trace.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_args.test_error_reports_named_path_on_stderr_not_stdout", + "eval.tests.test_cli_args.test_help_long_lists_options", + "eval.tests.test_cli_args.test_help_short_lists_name_and_path_arguments", + "eval.tests.test_cli_args.test_invalid_color_value_is_a_parse_error", + "eval.tests.test_cli_args.test_invalid_output_value_is_a_parse_error", + "eval.tests.test_cli_args.test_missing_new_path_is_reported", + "eval.tests.test_cli_args.test_missing_old_path_is_reported", + "eval.tests.test_cli_args.test_missing_path_far_from_store[new]", + "eval.tests.test_cli_args.test_missing_path_far_from_store[old]", + "eval.tests.test_cli_args.test_no_arguments_is_a_usage_error", + "eval.tests.test_cli_args.test_one_argument_reports_missing_new_path", + "eval.tests.test_cli_args.test_paths_are_not_canonicalized_before_existence_check", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--color=always]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--color=auto]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--color=never]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--force-correctness]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--output=human]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--quiet]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[--verbose]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[-q]", + "eval.tests.test_cli_args.test_store_flags_parse_cleanly[-v]", + "eval.tests.test_cli_args.test_unknown_option_is_a_parse_error", + "eval.tests.test_cli_args.test_version_long", + "eval.tests.test_cli_args.test_version_short", + "eval.tests.test_store_connection.test_all_backends_can_fail_when_command_missing", + "eval.tests.test_store_connection.test_command_backend_display_name_in_skip_logs", + "eval.tests.test_store_connection.test_connected_command_backend_after_db_failure[--color=never]", + "eval.tests.test_store_connection.test_connected_command_backend_after_db_failure[--force-correctness]", + "eval.tests.test_store_connection.test_connected_command_backend_after_db_failure[--output=human]", + "eval.tests.test_store_connection.test_db_connection_failures_are_warned", + "eval.tests.test_store_connection.test_default_backend_chain_has_three_backends", + "eval.tests.test_store_connection.test_default_chain_uses_immutable_sqlite_backend", + "eval.tests.test_store_connection.test_default_reports_some_backends_failed", + "eval.tests.test_store_connection.test_force_correctness_chain_has_two_backends", + "eval.tests.test_store_connection.test_force_correctness_omits_immutable_backend", + "eval.tests.test_store_connection.test_quiet_suppresses_connection_info", + "eval.tests.test_store_queries.test_closure_query_context_wraps_path", + "eval.tests.test_store_queries.test_closure_sums_nar_sizes", + "eval.tests.test_store_queries.test_command_backend_issues_both_query_kinds", + "eval.tests.test_store_queries.test_empty_closure_yields_zero_paths", + "eval.tests.test_store_queries.test_empty_system_derivations", + "eval.tests.test_store_queries.test_extra_columns_are_ignored", + "eval.tests.test_store_queries.test_fallback_surfaces_combined_error", + "eval.tests.test_store_queries.test_invalid_path_in_nix_store_output_is_rejected", + "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[bare-name]", + "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[empty-ish]", + "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[etc-path]", + "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[plain-relative]", + "eval.tests.test_store_queries.test_invalid_store_path_in_info_is_rejected[short-hash]", + "eval.tests.test_store_queries.test_missing_size_column_is_rejected", + "eval.tests.test_store_queries.test_multiple_spaces_separate_columns", + "eval.tests.test_store_queries.test_negative_size_is_parsed", + "eval.tests.test_store_queries.test_non_numeric_size_is_rejected", + "eval.tests.test_store_queries.test_nonzero_nix_store_exit_is_an_error", + "eval.tests.test_store_queries.test_nonzero_path_info_exit_code_rendered", + "eval.tests.test_store_queries.test_nonzero_path_info_exit_is_an_error", + "eval.tests.test_store_queries.test_path_info_unparsable_blank_line_is_ignored_only_when_blank", + "eval.tests.test_store_queries.test_query_failure_consistent_across_modes[args0]", + "eval.tests.test_store_queries.test_query_failure_consistent_across_modes[args1]", + "eval.tests.test_store_queries.test_selection_char_in_human_output", + "eval.tests.test_store_queries.test_single_identical_path_closure", + "eval.tests.test_store_queries.test_size_round_trip[1KiB]", + "eval.tests.test_store_queries.test_size_round_trip[1MiB]", + "eval.tests.test_store_queries.test_size_round_trip[one]", + "eval.tests.test_store_queries.test_size_round_trip[zero]", + "eval.tests.test_store_queries.test_system_derivations_marked_selected", + "eval.tests.test_store_queries.test_trailing_whitespace_in_info_line", + "eval.tests.test_store_queries.test_versionless_name_uses_placeholder", + "eval.tests.test_store_selection.test_amount_changed_same_version_counts", + "eval.tests.test_store_selection.test_newsystem_selected_only_marks_new_side", + "eval.tests.test_store_selection.test_selection_selected_in_human_marker", + "eval.tests.test_store_selection.test_selection_status_variants[newly-selected]", + "eval.tests.test_store_selection.test_selection_status_variants[newly-unselected]", + "eval.tests.test_store_selection.test_selection_status_variants[selected]", + "eval.tests.test_store_selection.test_selection_status_variants[unselected]", + "eval.tests.test_store_selection.test_significant_size_change_keeps_package_in_diffs", + "eval.tests.test_store_selection.test_sizes_aggregate_across_packages", + "eval.tests.test_store_selection.test_unselected_has_no_marker_in_human", + "eval.tests.test_store_selection.test_version_added_when_only_in_new", + "eval.tests.test_store_selection.test_version_changed_old_superseded_by_new", + "eval.tests.test_store_selection.test_version_downgrade_status", + "eval.tests.test_store_selection.test_version_removed_when_only_in_old", + "eval.tests.test_store_sqlite_db.test_sqlite_backend_connects_successfully_in_trace", + "eval.tests.test_store_sqlite_db.test_sqlite_backend_not_skipped_for_queries", + "eval.tests.test_store_sqlite_db.test_sqlite_backend_traces_both_query_kinds", + "eval.tests.test_store_sqlite_db.test_sqlite_broken_table_fails_run_via_fallback[Refs]", + "eval.tests.test_store_sqlite_db.test_sqlite_broken_table_fails_run_via_fallback[ValidPaths]", + "eval.tests.test_store_sqlite_db.test_sqlite_corrupt_database_fails_connect", + "eval.tests.test_store_sqlite_db.test_sqlite_db_absent_still_falls_to_command", + "eval.tests.test_store_sqlite_db.test_sqlite_force_correctness_opens_real_db", + "eval.tests.test_store_sqlite_db.test_sqlite_store_closure_totals_aggregate_members", + "eval.tests.test_store_sqlite_db.test_sqlite_store_dependency_added_removed", + "eval.tests.test_store_sqlite_db.test_sqlite_store_empty_database_returns_empty_diff", + "eval.tests.test_store_sqlite_db.test_sqlite_store_nonempty_sqlite_skips_command_backend", + "eval.tests.test_store_sqlite_db.test_sqlite_store_produces_version_change_diff", + "eval.tests.test_store_sqlite_db.test_sqlite_store_same_version_amount_change", + "eval.tests.test_store_sqlite_db.test_sqlite_store_size_reads_narsize_column", + "eval.tests.test_store_sqlite_db.test_sqlite_store_versionless_names_render_placeholder", + "eval.tests.test_store_trace.test_backend_count_reported_across_verbosities[-v]", + "eval.tests.test_store_trace.test_backend_count_reported_across_verbosities[-vv]", + "eval.tests.test_store_trace.test_backend_count_reported_across_verbosities[-vvv]", + "eval.tests.test_store_trace.test_backend_count_reported_across_verbosities[-vvvv]", + "eval.tests.test_store_trace.test_both_sqlite_backends_fail_to_connect", + "eval.tests.test_store_trace.test_command_backend_display_in_trace", + "eval.tests.test_store_trace.test_default_chain_backend_connection_order", + "eval.tests.test_store_trace.test_default_chain_registers_three_backends", + "eval.tests.test_store_trace.test_default_chain_skips_sqlite_for_every_query", + "eval.tests.test_store_trace.test_force_correctness_chain_has_two_backends", + "eval.tests.test_store_trace.test_force_correctness_never_attempts_immutable_connect", + "eval.tests.test_store_trace.test_force_correctness_skips_sqlite_only_backend_per_query", + "eval.tests.test_store_trace.test_no_verbosity_hides_backend_connection_detail", + "eval.tests.test_store_trace.test_some_backends_failed_warning_in_default_chain", + "eval.tests.test_store_trace.test_sqlite_backend_display_in_skip_log" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_args.test_help_prints_exact_document[-h]", + "reasons": [ + { + "detail": "AssertionError: assert 'Diff Nix\\n\\n...int version\\n' == 'Diff Nix\\n\\n...int version\\n' Skipping 74 identical leading characters in diff, use -v to show - + ? ++ - - - ", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_invalid_choice_reports_exact_possible_values[argv1-cli_invalid_output.golden]", + "reasons": [ + { + "detail": "assert \"error: inval...y '--help'.\\n\" == \"error: inval...y '--help'.\\n\" - error: invalid value 'xml' for '--output ' ? ^^^ + error: invalid value 'avif' for '--output ' ? ^^^^ [possibl", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_missing_both_args_is_usage_error", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_args.test_missing_new_path_is_usage_error", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_cli_args.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_golden_exact.test_human_body_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_golden_exact.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_golden_exact.test_rich_json_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_golden_exact.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_common_version_sets_omitted_flag_and_unchanged_rendering", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_report_diff_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_report_diff_coverage.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_human_amount_suffix_renders_multiplicity", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_report_diff_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_report_diff_coverage.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_multi_package_totals_and_ordering", + "reasons": [ + { + "detail": "AssertionError: assert {'old': 4, 'n... 'removed': 3} == {'old': 4, 'n... 'removed': 0} Omitting 2 identical items, use -vv to show Differing items: {'added': 4} != {'added': 1} {'removed': 3} != {'re", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_selection_char_in_human_body", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_report_diff_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old2-new2-Changed]", + "reasons": [ + { + "detail": "AssertionError: assert 'Downgraded' == 'Changed' - Changed + Downgraded", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old3-new3-Changed]", + "reasons": [ + { + "detail": "AssertionError: assert 'Upgraded' == 'Changed' - Changed + Upgraded", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-100-0]", + "reasons": [ + { + "detail": "assert 0 == 1 + where 0 = len([])", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-200-100]", + "reasons": [ + { + "detail": "assert 0 == 1 + where 0 = len([])", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-8292-8192]", + "reasons": [ + { + "detail": "assert 0 == 1 + where 0 = len([])", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_report_json.test_size_only_diff_accumulates_package_sizes", + "reasons": [ + { + "detail": "AssertionError: assert [{'kind': 'am...w_amount': 2}] == [] Left contains one more item: {'kind': 'amount_changed', 'version': {'name': '1.0'}, 'old_amount': 1, 'new_amount': 2} Full diff: - [] + [ +", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_closure_query_failure_matches_exact_report[fail_new_path_info-closure_path_info_new_error.golden]", + "reasons": [ + { + "detail": "AssertionError: assert 'Error: faile...ew store path' == 'Error: faile... store path\\n' Skipping 146 identical leading characters in diff, use -v to show - store path ? - + store path", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_closure_query_failure_matches_exact_report[fail_old_path_info-closure_path_info_error.golden]", + "reasons": [ + { + "detail": "AssertionError: assert 'Error: faile...ld store path' == 'Error: faile... store path\\n' Skipping 146 identical leading characters in diff, use -v to show - store path ? - + store path", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_default_chain_uses_three_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_snapshot_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_force_correctness_uses_two_backends", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_snapshot_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_old_closure_query_failure_names_only_old_side", + "reasons": [ + { + "detail": "AssertionError: assert 'Error: faile...ld store path' == 'Error: faile... store path\\n' Skipping 146 identical leading characters in diff, use -v to show - store path ? - + store path", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_snapshot_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_snapshot_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-a-1.0-100]", + "reasons": [ + { + "detail": "AssertionError: assert 'Removed' == 'Upgraded' - Upgraded + Removed", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-b-1.0-7]", + "reasons": [ + { + "detail": "AssertionError: assert 'b' == 'a' - a + b", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-c-1.0-0]", + "reasons": [ + { + "detail": "AssertionError: assert 'c' == 'a' - a + c", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_system_derivations_query_failure_matches_exact_report[fail_new_references-system_derivations_new_error.golden]", + "reasons": [ + { + "detail": "AssertionError: assert 'Error: faile...rences failed' == 'Error: faile...nces failed\\n' Skipping 152 identical leading characters in diff, use -v to show - nces failed ? - + nces failed", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_snapshot_errors.test_system_derivations_query_failure_matches_exact_report[fail_old_references-system_derivations_error.golden]", + "reasons": [ + { + "detail": "AssertionError: assert 'Error: faile...rences failed' == 'Error: faile...nces failed\\n' Skipping 152 identical leading characters in diff, use -v to show - nces failed ? - + nces failed", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_args.test_color_gating_ansi_header_when_force_enabled[env_extra0]", + "eval.tests.test_cli_args.test_color_gating_ansi_header_when_force_enabled[env_extra1]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra0]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra1]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra2]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra3]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra4]", + "eval.tests.test_cli_args.test_color_gating_plain_header_when_ansi_disabled[env_extra5]", + "eval.tests.test_cli_args.test_help_prints_exact_document[--help]", + "eval.tests.test_cli_args.test_help_prints_exact_document[-h]", + "eval.tests.test_cli_args.test_invalid_choice_reports_exact_possible_values[argv0-cli_invalid_color.golden]", + "eval.tests.test_cli_args.test_invalid_choice_reports_exact_possible_values[argv1-cli_invalid_output.golden]", + "eval.tests.test_cli_args.test_invalid_flag_or_value_is_exact_usage_error[argv0-cli_invalid_bogus.golden]", + "eval.tests.test_cli_args.test_invalid_flag_or_value_is_exact_usage_error[argv1-cli_invalid_color.golden]", + "eval.tests.test_cli_args.test_invalid_flag_or_value_is_exact_usage_error[argv2-cli_invalid_output.golden]", + "eval.tests.test_cli_args.test_invalid_flag_or_value_is_exact_usage_error[argv3-cli_invalid_fc.golden]", + "eval.tests.test_cli_args.test_missing_both_args_is_usage_error", + "eval.tests.test_cli_args.test_missing_new_path_is_usage_error", + "eval.tests.test_cli_args.test_missing_new_profile_path_reports_specific_error", + "eval.tests.test_cli_args.test_missing_old_profile_path_reports_specific_error", + "eval.tests.test_cli_args.test_old_path_validated_before_new_path", + "eval.tests.test_cli_args.test_version_prints_exact_program_version[--version]", + "eval.tests.test_cli_args.test_version_prints_exact_program_version[-V]", + "eval.tests.test_golden_exact.test_human_blank_line_separates_status_groups", + "eval.tests.test_golden_exact.test_human_body_matches_golden", + "eval.tests.test_golden_exact.test_human_reports_added_removed_and_changed_group_ordering", + "eval.tests.test_golden_exact.test_rich_json_closure_size_totals", + "eval.tests.test_golden_exact.test_rich_json_matches_golden", + "eval.tests.test_golden_exact.test_rich_json_names_are_sorted", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[alpha]", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[gone]", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[icon]", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[mango]", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[novell]", + "eval.tests.test_golden_exact.test_rich_json_parses_expected_fields_per_package[zeta]", + "eval.tests.test_golden_exact.test_rich_json_path_stats_exact", + "eval.tests.test_report_diff_coverage.test_common_version_sets_omitted_flag_and_unchanged_rendering", + "eval.tests.test_report_diff_coverage.test_derivation_suffix_stripped_from_package_name", + "eval.tests.test_report_diff_coverage.test_git_hash_version_reports_changed_not_ordered", + "eval.tests.test_report_diff_coverage.test_human_amount_suffix_renders_multiplicity", + "eval.tests.test_report_diff_coverage.test_hyphenated_version_component", + "eval.tests.test_report_diff_coverage.test_json_amount_gt_one_recorded", + "eval.tests.test_report_diff_coverage.test_mixed_status_from_conflicting_changes", + "eval.tests.test_report_diff_coverage.test_multi_package_totals_and_ordering", + "eval.tests.test_report_diff_coverage.test_no_common_version_no_unchanged_token", + "eval.tests.test_report_diff_coverage.test_no_version_unchanged_package_omitted", + "eval.tests.test_report_diff_coverage.test_package_size_delta_exact_signed", + "eval.tests.test_report_diff_coverage.test_pre_release_ordering_upgrades", + "eval.tests.test_report_diff_coverage.test_removed_amount_gt_one_recorded", + "eval.tests.test_report_diff_coverage.test_selection_char_in_human_body", + "eval.tests.test_report_diff_coverage.test_selection_matches_by_parsed_name_across_hashes", + "eval.tests.test_report_diff_coverage.test_selection_state_combinations[None-None-Unselected]", + "eval.tests.test_report_diff_coverage.test_selection_state_combinations[None-pkg-2.0-NewlySelected]", + "eval.tests.test_report_diff_coverage.test_selection_state_combinations[pkg-1.0-None-NewlyUnselected]", + "eval.tests.test_report_diff_coverage.test_selection_state_combinations[pkg-1.0-pkg-2.0-Selected]", + "eval.tests.test_report_diff_coverage.test_size_zero_closure_entry_counts", + "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old0-new0-Downgraded]", + "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old1-new1-Upgraded]", + "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old2-new2-Changed]", + "eval.tests.test_report_diff_coverage.test_status_from_version_lattice[old3-new3-Changed]", + "eval.tests.test_report_diff_coverage.test_system_derivations_failure_distinguishes_side[fail_new_references-new references failed]", + "eval.tests.test_report_diff_coverage.test_system_derivations_failure_distinguishes_side[fail_old_references-old references failed]", + "eval.tests.test_report_diff_coverage.test_unparsable_closure_path_dropped_from_diffs", + "eval.tests.test_report_diff_coverage.test_unparsable_selected_path_dropped", + "eval.tests.test_report_json.test_amount_change_on_removed_side", + "eval.tests.test_report_json.test_dependency_paths_do_not_force_selection", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions0-new_versions0-Upgraded]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions1-new_versions1-Downgraded]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions2-new_versions2-Removed]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions3-new_versions3-Added]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions4-new_versions4-Mixed]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions5-new_versions5-Changed]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions6-new_versions6-Upgraded]", + "eval.tests.test_report_json.test_diff_status_matches_version_change_direction[old_versions7-new_versions7-Changed]", + "eval.tests.test_report_json.test_has_omitted_versions_when_common_version_present", + "eval.tests.test_report_json.test_insignificant_size_only_change_omits_package_diff[100-100]", + "eval.tests.test_report_json.test_insignificant_size_only_change_omits_package_diff[100-200]", + "eval.tests.test_report_json.test_insignificant_size_only_change_omits_package_diff[100-8291]", + "eval.tests.test_report_json.test_insignificant_size_only_change_omits_package_diff[100-8292]", + "eval.tests.test_report_json.test_multiple_packages_sorted_by_name", + "eval.tests.test_report_json.test_negative_size_delta", + "eval.tests.test_report_json.test_no_omitted_versions_for_disjoint_versions", + "eval.tests.test_report_json.test_path_stats_are_unique_set_counts[old0-new0-2-1-0-1]", + "eval.tests.test_report_json.test_path_stats_are_unique_set_counts[old1-new1-1-2-1-0]", + "eval.tests.test_report_json.test_path_stats_are_unique_set_counts[old2-new2-2-1-0-1]", + "eval.tests.test_report_json.test_path_stats_are_unique_set_counts[old3-new3-3-2-1-2]", + "eval.tests.test_report_json.test_path_stats_are_unique_set_counts[old4-new4-1-1-1-1]", + "eval.tests.test_report_json.test_report_sizes_are_closure_byte_totals[old0-new0-expect0]", + "eval.tests.test_report_json.test_report_sizes_are_closure_byte_totals[old1-new1-expect1]", + "eval.tests.test_report_json.test_report_sizes_are_closure_byte_totals[old2-new2-expect2]", + "eval.tests.test_report_json.test_selection_counted_for_name_not_exact_path[selected_both-pkg-1.0-pkg-2.0]", + "eval.tests.test_report_json.test_selection_counted_for_name_not_exact_path[unselected-None-None]", + "eval.tests.test_report_json.test_selection_status_from_presence_in_system_profiles[1.0-2.0-Selected-1.0-2.0]", + "eval.tests.test_report_json.test_selection_status_from_presence_in_system_profiles[1.0-None-NewlyUnselected-1.0-2.0]", + "eval.tests.test_report_json.test_selection_status_from_presence_in_system_profiles[None-2.0-NewlySelected-1.0-2.0]", + "eval.tests.test_report_json.test_selection_status_from_presence_in_system_profiles[None-None-Unselected-1.0-2.0]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-100-0]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-1000000-999900]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-200-100]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-8292-8192]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-8293-8193]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[100-9000-8900]", + "eval.tests.test_report_json.test_significant_size_only_diff_emits_changed_package[9000-100--8900]", + "eval.tests.test_report_json.test_size_delta_is_new_minus_old", + "eval.tests.test_report_json.test_size_only_diff_accumulates_package_sizes", + "eval.tests.test_report_json.test_unchanged_package_produces_no_diff", + "eval.tests.test_report_json.test_version_diff_kinds_and_amounts[old0-new0-expected_versions0]", + "eval.tests.test_report_json.test_version_diff_kinds_and_amounts[old1-new1-expected_versions1]", + "eval.tests.test_report_json.test_version_diff_kinds_and_amounts[old2-new2-expected_versions2]", + "eval.tests.test_report_json.test_version_diff_kinds_and_amounts[old3-new3-expected_versions3]", + "eval.tests.test_report_json.test_version_diff_kinds_and_amounts[old4-new4-expected_versions4]", + "eval.tests.test_snapshot_errors.test_closure_query_failure_matches_exact_report[fail_new_path_info-closure_path_info_new_error.golden]", + "eval.tests.test_snapshot_errors.test_closure_query_failure_matches_exact_report[fail_old_path_info-closure_path_info_error.golden]", + "eval.tests.test_snapshot_errors.test_default_chain_uses_three_backends", + "eval.tests.test_snapshot_errors.test_empty_closures_both_sides_yield_empty_report", + "eval.tests.test_snapshot_errors.test_force_correctness_uses_two_backends", + "eval.tests.test_snapshot_errors.test_old_closure_query_failure_names_only_old_side", + "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-a-1.0-100]", + "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-b-1.0-7]", + "eval.tests.test_snapshot_errors.test_successful_snapshot_queries_reach_diff_output[/nix/store/0123456789abcdefghijklmnopqrstuv-c-1.0-0]", + "eval.tests.test_snapshot_errors.test_system_derivations_query_failure_matches_exact_report[fail_new_references-system_derivations_new_error.golden]", + "eval.tests.test_snapshot_errors.test_system_derivations_query_failure_matches_exact_report[fail_old_references-system_derivations_error.golden]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_behavior.test_disabled_color_env_still_emits_plain_report", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_empty_store_closures_produce_empty_diff", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_help_flag_prints_usage_with_subcommands", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_human_is_default_output_mode", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_invalid_color_value_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_invalid_output_format_value_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_single_argument_is_usage_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_behavior.test_store_access_error_when_mock_control_missing", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_behavior.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_derivation_and_none_semantics.test_derivation_selection_renders_selected_marker", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_derivation_and_none_semantics.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_diff_status.test_unchanged_package_does_not_appear_in_names", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_diff_status.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_diff_status.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_added_rendered_under_added_group", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_amount_suffix_rendered_for_duplicate_added", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_downgrade_renders_old_to_new", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_empty_diff_report_still_prints_stats", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_multi_version_added_rendered_commas", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_removed_rendered_under_removed_group", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_status_groups_emit_header_when_present", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_unchanged_marker_for_omitted_versions", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_rendering.test_upgrade_renders_old_to_new", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_rendering.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_json_output.test_json_empty_report", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_json_output.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_json_output.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_matching_and_amounts.test_extra_new_version_after_change_is_added", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_matching_and_amounts.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_matching_and_amounts.test_extra_old_version_after_change_is_removed", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_matching_and_amounts.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_matching_and_amounts.test_unchanged_middle_version_flags_omitted", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_matching_and_amounts.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_matching_and_amounts.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_multi_kind_composition.test_mixed_kind_human_line_renders_unchanged_marker", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_multi_kind_composition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_multi_kind_composition.test_multiple_unchanged_amounts_all_omitted", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_multi_kind_composition.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_multi_kind_composition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_multipackage_scenarios.test_human_view_of_mixed_report_groups", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_multipackage_scenarios.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_amount_changed_new_only_renders_amount_suffix", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_amount_changed_old_gt_one_renders_both_amounts", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_empty_new_version_renders_none_under_added", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_empty_version_renders_none_marker", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_mixed_status_renders_with_c_marker", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_omitted_unchanged_version_with_amount_gt_one", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_removed_package_renders_version_only", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_size_only_diff_negative_mib", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_size_only_diff_positive_mib", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_rendering_edge_cases.test_sub_threshold_growth_stays_in_bytes", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_rendering_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_size_and_selection.test_path_stats_counts_unique_paths", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_size_and_selection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_size_and_selection.test_path_stats_simple_add_and_remove", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_size_and_selection.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_size_and_selection.test_size_only_diff_renders_with_kiB_in_human", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_size_and_selection.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_errors.test_non_store_path_closure_line_aborts_with_error", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_errors.test_quiet_human_still_prints_report", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_behavior.test_disabled_color_env_still_emits_plain_report", + "eval.tests.test_cli_behavior.test_empty_store_closures_produce_empty_diff", + "eval.tests.test_cli_behavior.test_help_flag_prints_usage_with_subcommands", + "eval.tests.test_cli_behavior.test_human_is_default_output_mode", + "eval.tests.test_cli_behavior.test_invalid_color_value_is_rejected", + "eval.tests.test_cli_behavior.test_invalid_output_format_value_is_rejected", + "eval.tests.test_cli_behavior.test_missing_two_required_arguments_is_usage_error", + "eval.tests.test_cli_behavior.test_nonexistent_new_path_is_reported_err", + "eval.tests.test_cli_behavior.test_nonexistent_old_path_is_reported_err", + "eval.tests.test_cli_behavior.test_short_help_flag_is_accepted", + "eval.tests.test_cli_behavior.test_single_argument_is_usage_error", + "eval.tests.test_cli_behavior.test_store_access_error_when_mock_control_missing", + "eval.tests.test_cli_behavior.test_unknown_flag_is_usage_error", + "eval.tests.test_cli_behavior.test_verbosity_flags_still_produce_report[-q-False]", + "eval.tests.test_cli_behavior.test_verbosity_flags_still_produce_report[-qq-False]", + "eval.tests.test_cli_behavior.test_verbosity_flags_still_produce_report[-v-True]", + "eval.tests.test_cli_behavior.test_verbosity_flags_still_produce_report[-vv-True]", + "eval.tests.test_cli_behavior.test_version_flag_prints_semver", + "eval.tests.test_derivation_and_none_semantics.test_derivation_aggregates_with_normal_closure_same_name", + "eval.tests.test_derivation_and_none_semantics.test_derivation_path_without_version_has_none_version", + "eval.tests.test_derivation_and_none_semantics.test_derivation_selection_renders_selected_marker", + "eval.tests.test_derivation_and_none_semantics.test_derivation_suffix_stripped_from_version", + "eval.tests.test_derivation_and_none_semantics.test_digit_run_name_without_dash_becomes_distinct_packages", + "eval.tests.test_derivation_and_none_semantics.test_none_version_becomes_downgrade_when_version_added", + "eval.tests.test_derivation_and_none_semantics.test_none_version_becomes_upgrade_when_version_dropped", + "eval.tests.test_derivation_and_none_semantics.test_unchanged_no_version_package_emits_no_diff", + "eval.tests.test_diff_status.test_added_name_is_stripped_of_version", + "eval.tests.test_diff_status.test_added_package_status[0.0.1]", + "eval.tests.test_diff_status.test_added_package_status[1.0.0-alpha.1]", + "eval.tests.test_diff_status.test_added_package_status[1.0.0-pre]", + "eval.tests.test_diff_status.test_added_package_status[1.0.0]", + "eval.tests.test_diff_status.test_added_package_status[1.0]", + "eval.tests.test_diff_status.test_added_package_status[1]", + "eval.tests.test_diff_status.test_added_package_status[2.5.0]", + "eval.tests.test_diff_status.test_added_package_status[2026.09.01]", + "eval.tests.test_diff_status.test_diffs_canonicalized_alphabetically_by_name[names0]", + "eval.tests.test_diff_status.test_diffs_canonicalized_alphabetically_by_name[names1]", + "eval.tests.test_diff_status.test_downgraded_status_changed_pairs[1.0.0-beta-1.0.0-alpha]", + "eval.tests.test_diff_status.test_downgraded_status_changed_pairs[1.0.1-1.0.0]", + "eval.tests.test_diff_status.test_downgraded_status_changed_pairs[10.0.0-9.9.9]", + "eval.tests.test_diff_status.test_downgraded_status_changed_pairs[2.0.0-1.0.0]", + "eval.tests.test_diff_status.test_downgraded_status_changed_pairs[3.0-2.0]", + "eval.tests.test_diff_status.test_identical_snapshot_emits_no_diff[1.0.0-1.0.0]", + "eval.tests.test_diff_status.test_identical_snapshot_emits_no_diff[2.5.0-2.5.0]", + "eval.tests.test_diff_status.test_identical_snapshot_emits_no_diff[abc-def-abc-def]", + "eval.tests.test_diff_status.test_mixed_added_and_removed_versions_status", + "eval.tests.test_diff_status.test_mixed_upgrade_and_downgrade_status", + "eval.tests.test_diff_status.test_removed_and_added_distinct_packages", + "eval.tests.test_diff_status.test_removed_package_status[0.1.2]", + "eval.tests.test_diff_status.test_removed_package_status[1.0.0]", + "eval.tests.test_diff_status.test_removed_package_status[10.20.30]", + "eval.tests.test_diff_status.test_removed_package_status[2.0]", + "eval.tests.test_diff_status.test_unchanged_package_does_not_appear_in_names", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[0.1.0-0.2.0]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0-1.1]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0.0-1-1.0.0-2]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0.0-1.0.0.1]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0.0-1.0.1]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0.0-2.0.0]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.0.0-alpha-1.0.0-beta]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[1.9.9-2.0.0]", + "eval.tests.test_diff_status.test_upgraded_status_changed_pairs[2025.01.01-2026.01.01]", + "eval.tests.test_git_hash_versions.test_all_numeric_suffix_is_not_treated_as_hash", + "eval.tests.test_git_hash_versions.test_dated_component_before_hash_drives_upgrade", + "eval.tests.test_git_hash_versions.test_hash_downgrade_classified_changed_not_downgraded", + "eval.tests.test_git_hash_versions.test_hash_pair_renders_both_sides", + "eval.tests.test_git_hash_versions.test_long_git_hash_pair_classified_changed", + "eval.tests.test_git_hash_versions.test_mixed_content_suffix_is_ordered_not_hash", + "eval.tests.test_git_hash_versions.test_short_git_hash_pair_classified_changed", + "eval.tests.test_git_hash_versions.test_six_char_hash_like_is_not_treated_as_hash", + "eval.tests.test_human_rendering.test_added_rendered_under_added_group", + "eval.tests.test_human_rendering.test_amount_suffix_rendered_for_duplicate_added", + "eval.tests.test_human_rendering.test_downgrade_renders_old_to_new", + "eval.tests.test_human_rendering.test_empty_diff_report_still_prints_stats", + "eval.tests.test_human_rendering.test_multi_version_added_rendered_commas", + "eval.tests.test_human_rendering.test_removed_rendered_under_removed_group", + "eval.tests.test_human_rendering.test_report_order_changed_before_added_before_removed", + "eval.tests.test_human_rendering.test_status_groups_emit_header_when_present", + "eval.tests.test_human_rendering.test_unchanged_marker_for_omitted_versions", + "eval.tests.test_human_rendering.test_upgrade_renders_old_to_new", + "eval.tests.test_json_output.test_json_amount_changed_diff_shape", + "eval.tests.test_json_output.test_json_changed_diff_version_shape", + "eval.tests.test_json_output.test_json_diff_has_all_fields", + "eval.tests.test_json_output.test_json_empty_report", + "eval.tests.test_json_output.test_json_paths_counts", + "eval.tests.test_json_output.test_json_size_fields_reflect_closure_sizes", + "eval.tests.test_json_output.test_json_top_level_keys_and_types", + "eval.tests.test_matching_and_amounts.test_added_package_has_no_omitted", + "eval.tests.test_matching_and_amounts.test_amount_change_from_one_to_two", + "eval.tests.test_matching_and_amounts.test_amount_change_from_two_to_four", + "eval.tests.test_matching_and_amounts.test_duplicate_added_version_reported_with_amount", + "eval.tests.test_matching_and_amounts.test_duplicate_removed_version_reported_with_amount", + "eval.tests.test_matching_and_amounts.test_duplicate_triple_added_amount", + "eval.tests.test_matching_and_amounts.test_equal_duplicate_amounts_emit_no_diff", + "eval.tests.test_matching_and_amounts.test_every_version_changed_no_omitted", + "eval.tests.test_matching_and_amounts.test_extra_new_version_after_change_is_added", + "eval.tests.test_matching_and_amounts.test_extra_old_version_after_change_is_removed", + "eval.tests.test_matching_and_amounts.test_no_common_version_does_not_flag_omitted", + "eval.tests.test_matching_and_amounts.test_one_for_one_upgrade_pairs", + "eval.tests.test_matching_and_amounts.test_similar_versions_are_paired_as_changed", + "eval.tests.test_matching_and_amounts.test_unchanged_middle_version_flags_omitted", + "eval.tests.test_multi_kind_composition.test_added_then_amount_change_not_omitted", + "eval.tests.test_multi_kind_composition.test_mixed_kind_human_line_renders_unchanged_marker", + "eval.tests.test_multi_kind_composition.test_mixed_kind_versions_compose_in_one_diff", + "eval.tests.test_multi_kind_composition.test_multiple_unchanged_amounts_all_omitted", + "eval.tests.test_multipackage_scenarios.test_human_view_of_mixed_report_groups", + "eval.tests.test_multipackage_scenarios.test_mixed_report_add_upgrade_remove", + "eval.tests.test_multipackage_scenarios.test_nine_package_ordering", + "eval.tests.test_multipackage_scenarios.test_same_package_many_versions_net_change", + "eval.tests.test_multipackage_scenarios.test_sizes_aggregate_across_duplicate_same_name", + "eval.tests.test_multipackage_scenarios.test_two_packages_both_upgraded_sorted_by_name", + "eval.tests.test_multipackage_scenarios.test_version_net_zero_but_hashes_change_still_changed", + "eval.tests.test_rendering_edge_cases.test_amount_changed_new_only_renders_amount_suffix", + "eval.tests.test_rendering_edge_cases.test_amount_changed_old_gt_one_renders_both_amounts", + "eval.tests.test_rendering_edge_cases.test_empty_new_version_renders_none_under_added", + "eval.tests.test_rendering_edge_cases.test_empty_version_renders_none_marker", + "eval.tests.test_rendering_edge_cases.test_mixed_status_renders_with_c_marker", + "eval.tests.test_rendering_edge_cases.test_omitted_unchanged_version_with_amount_gt_one", + "eval.tests.test_rendering_edge_cases.test_removed_package_renders_version_only", + "eval.tests.test_rendering_edge_cases.test_size_only_diff_negative_mib", + "eval.tests.test_rendering_edge_cases.test_size_only_diff_positive_gib", + "eval.tests.test_rendering_edge_cases.test_size_only_diff_positive_mib", + "eval.tests.test_rendering_edge_cases.test_sub_threshold_growth_stays_in_bytes", + "eval.tests.test_size_and_selection.test_path_stats_counts_unique_paths", + "eval.tests.test_size_and_selection.test_path_stats_simple_add_and_remove", + "eval.tests.test_size_and_selection.test_selection_newly_selected", + "eval.tests.test_size_and_selection.test_selection_newly_unselected", + "eval.tests.test_size_and_selection.test_selection_reported_in_json[NewlySelected]", + "eval.tests.test_size_and_selection.test_selection_reported_in_json[NewlyUnselected]", + "eval.tests.test_size_and_selection.test_selection_reported_in_json[Selected]", + "eval.tests.test_size_and_selection.test_selection_reported_in_json[Unselected]", + "eval.tests.test_size_and_selection.test_selection_selected_when_in_both_system_sets", + "eval.tests.test_size_and_selection.test_selection_unselected_when_never_selected", + "eval.tests.test_size_and_selection.test_size_delta_negative", + "eval.tests.test_size_and_selection.test_size_line_reports_old_to_new_total", + "eval.tests.test_size_and_selection.test_size_only_diff_exactly_threshold_not_included", + "eval.tests.test_size_and_selection.test_size_only_diff_included_above_threshold", + "eval.tests.test_size_and_selection.test_size_only_diff_omitted_below_threshold", + "eval.tests.test_size_and_selection.test_size_only_diff_renders_with_kiB_in_human", + "eval.tests.test_store_path_errors.test_no_force_correctness_still_resolves_via_mock", + "eval.tests.test_store_path_errors.test_non_store_path_closure_line_aborts_with_error", + "eval.tests.test_store_path_errors.test_quiet_human_still_prints_report", + "eval.tests.test_store_path_errors.test_quiet_json_is_exact_with_no_diagnostics", + "eval.tests.test_store_path_errors.test_relative_closure_line_aborts_with_error", + "eval.tests.test_store_path_errors.test_store_path_with_empty_name_dropped_from_diffs", + "eval.tests.test_store_path_errors.test_text_only_suffix_kept_as_package_name", + "eval.tests.test_version_advanced_ordering.test_hash_pair_against_all_numeric_is_unordered", + "eval.tests.test_version_advanced_ordering.test_hash_unordered_plus_downgrade_is_downgraded", + "eval.tests.test_version_advanced_ordering.test_hash_unordered_plus_upgrade_is_upgraded", + "eval.tests.test_version_advanced_ordering.test_lowercase_vs_reverse_hash_pair_is_unordered", + "eval.tests.test_version_advanced_ordering.test_numeric_ranks_above_text_component[1.0.5-1.0.5b-Downgraded]", + "eval.tests.test_version_advanced_ordering.test_numeric_ranks_above_text_component[1.1-1.1-pre-Downgraded]", + "eval.tests.test_version_advanced_ordering.test_numeric_ranks_above_text_component[1.1-1.1a-Downgraded]", + "eval.tests.test_version_advanced_ordering.test_numeric_ranks_above_text_component[1.1a-1.1-Upgraded]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[01.0.0-1.0.0]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[02-2]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[1.0.0-01.0.0]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[1.010-1.10]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[1.10-1.010]", + "eval.tests.test_version_advanced_ordering.test_numeric_zero_equality_is_changed[10.01-10.1]", + "eval.tests.test_version_advanced_ordering.test_oversized_numeric_component_uses_string_fallback[12345678901234567890123456789012345678901-22345678901234567890123456789012345678901-Upgraded]", + "eval.tests.test_version_advanced_ordering.test_oversized_numeric_component_uses_string_fallback[22345678901234567890123456789012345678901-12345678901234567890123456789012345678901-Downgraded]", + "eval.tests.test_version_advanced_ordering.test_oversized_numeric_component_uses_string_fallback[99999999999999999999999999999999999999999-99999999999999999999999999999999999999998-Downgraded]", + "eval.tests.test_version_advanced_ordering.test_single_unordered_hash_change_is_changed_not_mixed", + "eval.tests.test_version_advanced_ordering.test_two_hash_only_unordered_changes_is_changed", + "eval.tests.test_version_advanced_ordering.test_uppercase_hex_hash_pair_is_unordered", + "eval.tests.test_version_parsing.test_alphanumeric_component_ahead_of_numeric", + "eval.tests.test_version_parsing.test_component_numeric_ordering[0.9.9-0.10.0-Upgraded]", + "eval.tests.test_version_parsing.test_component_numeric_ordering[1.10.0-1.9.0-Downgraded]", + "eval.tests.test_version_parsing.test_component_numeric_ordering[1.9.9-2.0.0-Upgraded]", + "eval.tests.test_version_parsing.test_component_numeric_ordering[10.0.0-9.0.0-Downgraded]", + "eval.tests.test_version_parsing.test_component_numeric_ordering[2.0.9-2.1.0-Upgraded]", + "eval.tests.test_version_parsing.test_multi_package_same_version_different_hashes_size_change", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-1.0.0-beta-Downgraded]", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-alpha-1.0.0-Upgraded]", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-alpha-1.0.0-beta-Upgraded]", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-beta-1.0.0-rc-Upgraded]", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-beta.11-1.0.0-beta.2-Downgraded]", + "eval.tests.test_version_parsing.test_prerelease_ordering[1.0.0-rc1-1.0.0-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-1.0.0-1-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-1.0.0-alpha-Downgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-1.0.0.1-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-1.0.1-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-alpha-1.0.0-1-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-numeric-1.0.0-0-Upgraded]", + "eval.tests.test_version_parsing.test_suffix_ordering_classification[1.0.0-pre-1.0.0-alpha-Upgraded]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1 2]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1*2]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1.0.0]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1=2]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1\\xd72]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[1_2+3]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[V1.2.3]", + "eval.tests.test_version_parsing.test_version_parsing_roundtrip_matches_itself[firefox-123.0.1]", + "eval.tests.test_version_parsing.test_version_split_on_underscore_and_hyphen", + "eval.tests.test_version_parsing.test_version_with_leading_letter_parses_name", + "eval.tests.test_version_separator_edges.test_extra_separators_still_split_components[1*2-1*3]", + "eval.tests.test_version_separator_edges.test_extra_separators_still_split_components[1.0.0+b-1.0.0+c]", + "eval.tests.test_version_separator_edges.test_extra_separators_still_split_components[1=9-1=10]", + "eval.tests.test_version_separator_edges.test_extra_separators_still_split_components[1\\xd72-1\\xd73]", + "eval.tests.test_version_separator_edges.test_numeric_overflow_component_uses_string_fallback", + "eval.tests.test_version_separator_edges.test_pre_text_suffix_ordering[1.0.0-pre-1.0.0-abc]", + "eval.tests.test_version_separator_edges.test_pre_text_suffix_ordering[1.0.0-pre-1.0.0-rc]", + "eval.tests.test_version_separator_edges.test_pre_text_suffix_ordering[1.0.0-pre-1.0.0]", + "eval.tests.test_version_separator_edges.test_same_components_different_separators_count_as_changed", + "eval.tests.test_version_separator_edges.test_single_component_version_upgrade" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_arguments.test_extra_positional_argument_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_help_subcommand_style_at_end", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_invalid_color_value_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_invalid_output_value_is_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_long_help_documents_positional_and_options", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_missing_both_positional_args_is_usage_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_missing_only_old_path_is_usage_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_short_help_is_compact_summary", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_arguments.test_unknown_flag_reports_unexpected_argument", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_arguments.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_added_package_section", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_amount_changed_renders_multiply_suffix", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_changed_incomparable_versions_status_char", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_downgraded_package_status_char", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_has_omitted_versions_shows_unchanged_marker", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_mixed_upgrade_and_downgrade_status", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_path_stats_line_reports_counts", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_removed_package_section", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_selection_chars_all_variants", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_size_only_diff_above_threshold", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_unchanged_package_is_not_rendered", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_human_report.test_upgraded_package_status_char", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_human_report.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_path_validation.test_headers_render_for_valid_dirs_without_nix", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_path_validation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_path_validation.test_new_path_missing_errors", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_path_validation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_path_validation.test_old_path_missing_errors_before_any_output", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_path_validation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_path_validation.test_old_path_that_is_a_file_still_reaches_diff", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_path_validation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_dashed_system_generations_split", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_derivation_suffix_is_stripped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_empty_closure_both_sides_succeeds", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_hyphenated_version_split", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_invalid_store_format_path_is_dropped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_no_version_package", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_omitted_unchanged_marker_placement", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_single_over_threshold_package_delta_shown", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_unparsable_path_without_hyphen_dropped", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_render_edge_cases.test_version_with_dots", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_render_edge_cases.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_double_leading_hyphen_name", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_hyphenated_version_preserved_in_both_modes", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_leading_hyphen_name_json", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_leading_hyphen_name_splits_after_skipped_index", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_malformed_name_dropped_on_new_side", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_store_path_parsing.test_non_store_path_fatal_in_json_mode", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_store_path_parsing.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_default_level_emits_no_log_markers", + "reasons": [ + { + "detail": "AssertionError: assert '[U.] base 1.0 -> 2.0' in '<<< /tmp/pytest-of-root/pytest-2/popen-gw8/test_default_level_emits_no_lo0/store_fixture/old\\n>>> /tmp/pytest-of-root...xture/new\\n\\nCHANGED\\n[U*] bas", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_v_enables_warn_level", + "reasons": [ + { + "detail": "AssertionError: assert '[U.] base 1.0 -> 2.0' in '<<< /tmp/pytest-of-root/pytest-2/popen-gw9/test_v_enables_warn_level0/store_fixture/old\\n>>> /tmp/pytest-of-root/pyte...connected\\n\\nCHANGED\\n[U*] bas", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_verbose_levels_progress_supersede", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "pass_body", + "message": "pytest test body is only pass", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace pass-only test bodies with executable behavior checks.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_vv_enables_info_and_warn", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_vvv_enables_debug_connect_inspection", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_verbosity_logging.test_vvvv_enables_trace_store_path_validation", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_verbosity_logging.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_arguments.test_capital_v_version_alias", + "eval.tests.test_cli_arguments.test_extra_positional_argument_is_rejected", + "eval.tests.test_cli_arguments.test_force_correctness_flag_is_boolean_no_value", + "eval.tests.test_cli_arguments.test_help_subcommand_style_at_end", + "eval.tests.test_cli_arguments.test_invalid_color_value_is_rejected", + "eval.tests.test_cli_arguments.test_invalid_output_value_is_rejected", + "eval.tests.test_cli_arguments.test_long_help_documents_positional_and_options", + "eval.tests.test_cli_arguments.test_long_help_lists_possible_output_values", + "eval.tests.test_cli_arguments.test_missing_both_positional_args_is_usage_error", + "eval.tests.test_cli_arguments.test_missing_only_old_path_is_usage_error", + "eval.tests.test_cli_arguments.test_missing_value_for_expects_arg_flag[missing_color_value]", + "eval.tests.test_cli_arguments.test_missing_value_for_expects_arg_flag[missing_output_value]", + "eval.tests.test_cli_arguments.test_short_help_is_compact_summary", + "eval.tests.test_cli_arguments.test_unknown_flag_reports_unexpected_argument", + "eval.tests.test_cli_arguments.test_version_flag_prints_dix_version", + "eval.tests.test_color_handling.test_clicolor_force_colors_auto_on_pipe", + "eval.tests.test_color_handling.test_clicolor_one_without_force_keeps_pipe_plain", + "eval.tests.test_color_handling.test_clicolor_zero_suppresses_auto", + "eval.tests.test_color_handling.test_color_always_emits_bold_header_sgr", + "eval.tests.test_color_handling.test_color_always_ignores_no_color", + "eval.tests.test_color_handling.test_color_auto_on_pipe_is_uncolored", + "eval.tests.test_color_handling.test_color_never_strips_all_ansi", + "eval.tests.test_color_handling.test_empty_no_color_does_not_suppress_force", + "eval.tests.test_color_handling.test_no_color_any_nonempty_value_suppresses", + "eval.tests.test_color_handling.test_no_color_suppresses_auto", + "eval.tests.test_color_handling.test_no_color_takes_precedence_over_clicolor_force", + "eval.tests.test_human_report.test_added_package_section", + "eval.tests.test_human_report.test_amount_changed_renders_multiply_suffix", + "eval.tests.test_human_report.test_changed_incomparable_versions_status_char", + "eval.tests.test_human_report.test_downgraded_package_status_char", + "eval.tests.test_human_report.test_driver_returns_success_exit_code", + "eval.tests.test_human_report.test_has_omitted_versions_shows_unchanged_marker", + "eval.tests.test_human_report.test_insignificant_size_change_is_not_a_diff", + "eval.tests.test_human_report.test_mixed_upgrade_and_downgrade_status", + "eval.tests.test_human_report.test_packages_sorted_within_status_group", + "eval.tests.test_human_report.test_path_stats_line_reports_counts", + "eval.tests.test_human_report.test_removed_package_section", + "eval.tests.test_human_report.test_sections_are_grouped_and_ordered", + "eval.tests.test_human_report.test_selection_chars_all_variants", + "eval.tests.test_human_report.test_single_bottom_summary_even_with_many_packages", + "eval.tests.test_human_report.test_size_and_diff_summary_when_growing", + "eval.tests.test_human_report.test_size_and_diff_summary_when_shrinking", + "eval.tests.test_human_report.test_size_only_diff_above_threshold", + "eval.tests.test_human_report.test_unchanged_package_is_not_rendered", + "eval.tests.test_human_report.test_upgraded_package_status_char", + "eval.tests.test_json_report.test_added_package_json", + "eval.tests.test_json_report.test_amount_changed_json_kind", + "eval.tests.test_json_report.test_changed_version_json_kind", + "eval.tests.test_json_report.test_empty_diff_json_structure", + "eval.tests.test_json_report.test_json_diffs_sorted_by_name", + "eval.tests.test_json_report.test_json_has_no_trailing_newline", + "eval.tests.test_json_report.test_json_has_omitted_versions_flag", + "eval.tests.test_json_report.test_json_mixed_and_downgraded_statuses", + "eval.tests.test_json_report.test_json_path_stats_counts", + "eval.tests.test_json_report.test_json_selection_statuses", + "eval.tests.test_json_report.test_json_total_sizes_are_byte_sums", + "eval.tests.test_json_report.test_json_version_amount_added_renders_amount", + "eval.tests.test_json_report.test_removed_package_json", + "eval.tests.test_json_report.test_size_only_diff_json_has_empty_versions", + "eval.tests.test_path_validation.test_both_paths_missing_reports_old_first", + "eval.tests.test_path_validation.test_headers_render_for_valid_dirs_without_nix", + "eval.tests.test_path_validation.test_json_mode_still_validates_paths_first", + "eval.tests.test_path_validation.test_new_path_missing_errors", + "eval.tests.test_path_validation.test_old_path_missing_errors_before_any_output", + "eval.tests.test_path_validation.test_old_path_that_is_a_file_still_reaches_diff", + "eval.tests.test_path_validation.test_relative_missing_path_in_tree_is_reported", + "eval.tests.test_path_validation.test_valid_paths_render_canonicalized_headers", + "eval.tests.test_render_edge_cases.test_dashed_system_generations_split", + "eval.tests.test_render_edge_cases.test_derivation_suffix_is_stripped", + "eval.tests.test_render_edge_cases.test_empty_closure_both_sides_succeeds", + "eval.tests.test_render_edge_cases.test_git_hash_version_rendered_as_version", + "eval.tests.test_render_edge_cases.test_hyphenated_version_split", + "eval.tests.test_render_edge_cases.test_invalid_store_format_path_is_dropped", + "eval.tests.test_render_edge_cases.test_name_padding_aligns_versions", + "eval.tests.test_render_edge_cases.test_no_version_package", + "eval.tests.test_render_edge_cases.test_omitted_unchanged_marker_placement", + "eval.tests.test_render_edge_cases.test_single_over_threshold_package_delta_shown", + "eval.tests.test_render_edge_cases.test_unparsable_path_without_hyphen_dropped", + "eval.tests.test_render_edge_cases.test_version_with_dots", + "eval.tests.test_store_path_parsing.test_double_leading_hyphen_name", + "eval.tests.test_store_path_parsing.test_hyphenated_version_preserved_in_both_modes", + "eval.tests.test_store_path_parsing.test_leading_hyphen_name_json", + "eval.tests.test_store_path_parsing.test_leading_hyphen_name_splits_after_skipped_index", + "eval.tests.test_store_path_parsing.test_long_git_hash_component_parsed_as_version", + "eval.tests.test_store_path_parsing.test_malformed_name_dropped_on_new_side", + "eval.tests.test_store_path_parsing.test_malformed_store_name_dropped_json[empty-name]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_dropped_json[no-hyphen]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_dropped_json[non-alnum-hash]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_dropped_json[short-hash]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_is_dropped_human[empty-name]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_is_dropped_human[no-hyphen]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_is_dropped_human[non-alnum-hash]", + "eval.tests.test_store_path_parsing.test_malformed_store_name_is_dropped_human[short-hash]", + "eval.tests.test_store_path_parsing.test_non_store_path_fatal_in_json_mode", + "eval.tests.test_store_path_parsing.test_non_store_path_fatal_with_force_correctness", + "eval.tests.test_store_path_parsing.test_non_store_path_in_new_closure_is_fatal[opt]", + "eval.tests.test_store_path_parsing.test_non_store_path_in_new_closure_is_fatal[var]", + "eval.tests.test_store_path_parsing.test_non_store_path_in_old_closure_is_fatal[bare-slash-prefix]", + "eval.tests.test_store_path_parsing.test_non_store_path_in_old_closure_is_fatal[home]", + "eval.tests.test_store_path_parsing.test_non_store_path_in_old_closure_is_fatal[opt]", + "eval.tests.test_store_path_parsing.test_non_store_path_in_old_closure_is_fatal[var]", + "eval.tests.test_verbosity_logging.test_default_level_emits_no_log_markers", + "eval.tests.test_verbosity_logging.test_v_enables_warn_level", + "eval.tests.test_verbosity_logging.test_v_with_force_correctness_warns_exactly", + "eval.tests.test_verbosity_logging.test_verbose_levels_progress_supersede", + "eval.tests.test_verbosity_logging.test_vv_enables_info_and_warn", + "eval.tests.test_verbosity_logging.test_vvv_enables_debug_connect_inspection", + "eval.tests.test_verbosity_logging.test_vvvv_enables_trace_store_path_validation" + ] + } + }, + "commit": "bb78117425dea82d840a032b594f3641f3f3b399", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.7019132112123438, + "eval_clean_hashes": [ + "f748639f2444e8ddefb59ff872d2e8c6afd0c63f8ad2d15ea5c752baf858f871" + ], + "input_record": { + "codeql_db_mb": 84.65, + "codeql_status": true, + "codeql_time": 41.51985161798075, + "commit": "bb78117425dea82d840a032b594f3641f3f3b399", + "commits": 297, + "contributors": 8, + "difficulty": "easy", + "difficulty_code_lines": 5034, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 5034, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.7019132112123438, + "difficulty_test_code_lines": 524, + "full_name": "manic-systems/dix", + "github_stars": null, + "input_codeql_db": "rust_codeql/manic-systems__dix", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "pemistahl/grex", + "rank": 931, + "similarity": 0.4440118074417114 + }, + { + "pb_fullname": "BurntSushi/ripgrep", + "rank": 121, + "similarity": 0.4856228828430176 + }, + { + "pb_fullname": "nachoparker/dutree", + "rank": 490, + "similarity": 0.48426640033721924 + }, + { + "pb_fullname": "Canop/rhit", + "rank": 308, + "similarity": 0.4606286883354187 + }, + { + "pb_fullname": "sharkdp/hexyl", + "rank": 623, + "similarity": 0.4403887689113617 + }, + { + "pb_fullname": "altdesktop/i3-style", + "rank": 660, + "similarity": 0.44135743379592896 + }, + { + "pb_fullname": "sayanarijit/xplr", + "rank": 636, + "similarity": 0.5179523229598999 + }, + { + "pb_fullname": "alexpovel/srgn", + "rank": 756, + "similarity": 0.4757634699344635 + }, + { + "pb_fullname": "git-bahn/git-graph", + "rank": 555, + "similarity": 0.4677295386791229 + }, + { + "pb_fullname": "rvben/rumdl", + "rank": 381, + "similarity": 0.47805720567703247 + }, + { + "pb_fullname": "dandavison/delta", + "rank": 115, + "similarity": 0.5610834956169128 + }, + { + "pb_fullname": "bootandy/dust", + "rank": 434, + "similarity": 0.49355220794677734 + }, + { + "pb_fullname": "sharkdp/hyperfine", + "rank": 532, + "similarity": 0.4688791036605835 + }, + { + "pb_fullname": "jhspetersson/fselect", + "rank": 626, + "similarity": 0.4381820559501648 + }, + { + "pb_fullname": "dalance/amber", + "rank": 277, + "similarity": 0.5117480158805847 + }, + { + "pb_fullname": "ajeetdsouza/zoxide", + "rank": 558, + "similarity": 0.4974817633628845 + }, + { + "pb_fullname": "stacked-git/stgit", + "rank": 91, + "similarity": 0.5468611121177673 + }, + { + "pb_fullname": "blacknon/hwatch", + "rank": 89, + "similarity": 0.6152136921882629 + }, + { + "pb_fullname": "foriequal0/git-trim", + "rank": 110, + "similarity": 0.46469080448150635 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 3, + "similarity": 0.7022693157196045 + }, + { + "pb_fullname": "sstadick/hck", + "rank": 482, + "similarity": 0.445686012506485 + }, + { + "pb_fullname": "tarka/xcp", + "rank": 510, + "similarity": 0.4527984857559204 + }, + { + "pb_fullname": "o2sh/onefetch", + "rank": 313, + "similarity": 0.5105773210525513 + }, + { + "pb_fullname": "sitkevij/hex", + "rank": 299, + "similarity": 0.49868762493133545 + }, + { + "pb_fullname": "codesnap-rs/codesnap", + "rank": 674, + "similarity": 0.5315866470336914 + }, + { + "pb_fullname": "ismaelgv/rnr", + "rank": 125, + "similarity": 0.47381430864334106 + }, + { + "pb_fullname": "sirwart/ripsecrets", + "rank": 934, + "similarity": 0.46172648668289185 + }, + { + "pb_fullname": "sharkdp/pastel", + "rank": 881, + "similarity": 0.4559308588504791 + }, + { + "pb_fullname": "astro/deadnix", + "rank": 2, + "similarity": 0.6890174746513367 + }, + { + "pb_fullname": "wfxr/code-minimap", + "rank": 895, + "similarity": 0.49915266036987305 + }, + { + "pb_fullname": "riquito/tuc", + "rank": 486, + "similarity": 0.43675497174263 + }, + { + "pb_fullname": "simeg/eureka", + "rank": 767, + "similarity": 0.4652133882045746 + }, + { + "pb_fullname": "clog-tool/clog-cli", + "rank": 147, + "similarity": 0.49764323234558105 + }, + { + "pb_fullname": "rhysd/kiro-editor", + "rank": 603, + "similarity": 0.5078369975090027 + }, + { + "pb_fullname": "ast-grep/ast-grep", + "rank": 391, + "similarity": 0.5407803654670715 + }, + { + "pb_fullname": "chmln/sd", + "rank": 228, + "similarity": 0.5118221044540405 + }, + { + "pb_fullname": "kyoheiu/felix", + "rank": 607, + "similarity": 0.5147648453712463 + }, + { + "pb_fullname": "mgdm/htmlq", + "rank": 895, + "similarity": 0.4357093870639801 + }, + { + "pb_fullname": "parcel-bundler/lightningcss", + "rank": 704, + "similarity": 0.45442044734954834 + }, + { + "pb_fullname": "konradsz/igrep", + "rank": 600, + "similarity": 0.48363351821899414 + }, + { + "pb_fullname": "trasta298/keifu", + "rank": 740, + "similarity": 0.48087751865386963 + }, + { + "pb_fullname": "Canop/broot", + "rank": 444, + "similarity": 0.5178722143173218 + }, + { + "pb_fullname": "sharkdp/fd", + "rank": 282, + "similarity": 0.472207248210907 + }, + { + "pb_fullname": "pls-rs/pls", + "rank": 135, + "similarity": 0.5101629495620728 + }, + { + "pb_fullname": "Byron/dua-cli", + "rank": 391, + "similarity": 0.4628875255584717 + }, + { + "pb_fullname": "mookid/diffr", + "rank": 22, + "similarity": 0.6560487747192383 + }, + { + "pb_fullname": "anordal/shellharden", + "rank": 237, + "similarity": 0.5292843580245972 + }, + { + "pb_fullname": "sharkdp/bat", + "rank": 188, + "similarity": 0.560279130935669 + }, + { + "pb_fullname": "XAMPPRocky/tokei", + "rank": 438, + "similarity": 0.44431644678115845 + }, + { + "pb_fullname": "yassinebridi/serpl", + "rank": 687, + "similarity": 0.5294556617736816 + }, + { + "pb_fullname": "tree-sitter/tree-sitter", + "rank": 877, + "similarity": 0.4416469633579254 + }, + { + "pb_fullname": "yaa110/nomino", + "rank": 364, + "similarity": 0.46134424209594727 + } + ], + "repo_age": null, + "repo_path": "rust/manic-systems__dix", + "rust_channel": "stable", + "rust_edition": "2024", + "rust_release_date": "2026-04-16", + "rust_version": "1.95.0", + "rust_version_source": "rust-version", + "source": "commit:bb78117425dea82d840a032b594f3641f3f3b399", + "status": "done", + "url": "https://github.com/manic-systems/dix" + }, + "instance_id": "manic-systems__dix.bb78117", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "manic-systems/dix" +} diff --git a/manic-systems--dix.bb78117/tests/test.sh b/manic-systems--dix.bb78117/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/manic-systems--dix.bb78117/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/manic-systems--dix.bb78117/tests/workspace.tar.gz b/manic-systems--dix.bb78117/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..200aa34aebb1eb91feadb96842ce240700ab59ba --- /dev/null +++ b/manic-systems--dix.bb78117/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:530c588bd865a8ec53b7f86a2394a50031809b47031b5a0289c6017b139f4d4a +size 4120 diff --git a/manishearth--elsa.91944aa/environment/Dockerfile b/manishearth--elsa.91944aa/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/manishearth--elsa.91944aa/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/manishearth--elsa.91944aa/environment/download.sh b/manishearth--elsa.91944aa/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..9ed0509d54d6bd984c5d01a85325fea5be73d129 --- /dev/null +++ b/manishearth--elsa.91944aa/environment/download.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# download.sh for the ProgramGym offline build of https://github.com/Manishearth/elsa. +# +# This stage runs as: source /source_ro/download.sh (from a read-only mount, with network). +# It ONLY prefetches Cargo dependencies into the shared CARGO_HOME registry cache and exports +# environment variables that build.sh depends on. It performs no compile/link/test/build step. +# +# It is a completely standalone single file: it does not read Cargo.toml, Cargo.lock, or any +# other repository file. All dependency information is embedded inline below. The real repo +# (Cargo.toml) declares dependencies stable_deref_trait = "1.1.1" and optional indexmap = +# "2.0.2"; this generated manifest mirrors that exact graph so that the offline build in +# build.sh can resolve every crate from the cache. + +set -e + +# Work in an isolated temp directory so we never touch the read-only /source_ro mount. +PREFETCH_DIR="$(mktemp -d /tmp/elsa-prefetch.XXXXXX)" + +cat > "${PREFETCH_DIR}/Cargo.toml" <<'EOF' +[package] +name = "elsa-prefetch" +version = "0.0.0" +edition = "2018" + +# Mirror of the real elsa dependency graph (stable_deref_trait + optional indexmap). +[dependencies] +stable_deref_trait = "1.1.1" +indexmap = { version = "2.0.2", optional = true } +EOF + +mkdir -p "${PREFETCH_DIR}/src" +printf 'pub fn placeholder() {}\n' > "${PREFETCH_DIR}/src/lib.rs" + +# Populate the shared CARGO_HOME registry cache with every crate the offline build needs. +# Using --manifest-path guarantees cargo resolves against the generated manifest only. +cargo fetch --manifest-path "${PREFETCH_DIR}/Cargo.toml" + +# Export the offline flag so build.sh never attempts network resolution. +export CARGO_NET_OFFLINE="true" + +# Clean up the temporary prefetch directory (cache already lives in CARGO_HOME). +rm -rf "${PREFETCH_DIR}" diff --git a/manishearth--elsa.91944aa/environment/executable b/manishearth--elsa.91944aa/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..60b8c0b92937f5d8e418eefd864fbe32ff416bb5 --- /dev/null +++ b/manishearth--elsa.91944aa/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d4364f85ada7cf22ae6026e7ca51c5431d7e7b7c3a122a237d145f221cc01dc +size 448784 diff --git a/manishearth--elsa.91944aa/environment/harbor_prepare_download_env.sh b/manishearth--elsa.91944aa/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/manishearth--elsa.91944aa/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manishearth--elsa.91944aa/environment/workspace.tar.gz b/manishearth--elsa.91944aa/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..afb29ccc5b46315dcccba7ee73eebe7fa4726b72 --- /dev/null +++ b/manishearth--elsa.91944aa/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9422238df6471cf41d6001deb6becfa4d7ad14e6097dbb4f02e40fe70308fbd +size 2053 diff --git a/manishearth--elsa.91944aa/instruction.md b/manishearth--elsa.91944aa/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/manishearth--elsa.91944aa/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/manishearth--elsa.91944aa/solution/solve.sh b/manishearth--elsa.91944aa/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/manishearth--elsa.91944aa/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/manishearth--elsa.91944aa/task.toml b/manishearth--elsa.91944aa/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5845205e412daeaedae8667d9fe7d8e21a17bde0 --- /dev/null +++ b/manishearth--elsa.91944aa/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/manishearth--elsa.91944aa" +description = "Synthetic ProgramGym cleanroom reconstruction task for Manishearth/elsa" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "Manishearth__elsa.91944aa" +repository = "Manishearth/elsa" +commit = "91944aacda886a054a8e3ba9aa91c73ea04de96c" +language = "rust" +difficulty = "easy" +difficulty_score = 1.9405662864900903 +test_branches = 4 +test_count = 220 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/manishearth--elsa.91944aa/tests/Dockerfile b/manishearth--elsa.91944aa/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/manishearth--elsa.91944aa/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_01.tar.gz b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4d529280f94095c9c9e1fc1bfd66e5969bf14e4f --- /dev/null +++ b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:532075bf246faf5f1ac082ece70e29de8e5448dd90a5b0d4deb0cf8dcc440eb4 +size 5699 diff --git a/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_02.tar.gz b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f7bc28fdf9d1b4c36107bf827df0f127c3201c6a --- /dev/null +++ b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b08bd31bd202d59a5a312845031c021b119b7f0f6084406061677f150c670b2 +size 19697 diff --git a/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_03.tar.gz b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0e06ca883061c7feedd7658f7ff3c72ed8929fd5 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:648cf8f24c5e70424abe99dac621a579d6eecde12bdb83c6d460a73b25d6bf4d +size 8045 diff --git a/manishearth--elsa.91944aa/tests/blobs/tests/generated_upstream.tar.gz b/manishearth--elsa.91944aa/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..67b5957e8e4bf02d5a56c8a9516163efdf0dbd9d --- /dev/null +++ b/manishearth--elsa.91944aa/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09117823b4b78f033370eace3f26c2bd40ff03c02fa53971498afc3cb430f066 +size 2376 diff --git a/manishearth--elsa.91944aa/tests/download.sh b/manishearth--elsa.91944aa/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..9ed0509d54d6bd984c5d01a85325fea5be73d129 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/download.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# download.sh for the ProgramGym offline build of https://github.com/Manishearth/elsa. +# +# This stage runs as: source /source_ro/download.sh (from a read-only mount, with network). +# It ONLY prefetches Cargo dependencies into the shared CARGO_HOME registry cache and exports +# environment variables that build.sh depends on. It performs no compile/link/test/build step. +# +# It is a completely standalone single file: it does not read Cargo.toml, Cargo.lock, or any +# other repository file. All dependency information is embedded inline below. The real repo +# (Cargo.toml) declares dependencies stable_deref_trait = "1.1.1" and optional indexmap = +# "2.0.2"; this generated manifest mirrors that exact graph so that the offline build in +# build.sh can resolve every crate from the cache. + +set -e + +# Work in an isolated temp directory so we never touch the read-only /source_ro mount. +PREFETCH_DIR="$(mktemp -d /tmp/elsa-prefetch.XXXXXX)" + +cat > "${PREFETCH_DIR}/Cargo.toml" <<'EOF' +[package] +name = "elsa-prefetch" +version = "0.0.0" +edition = "2018" + +# Mirror of the real elsa dependency graph (stable_deref_trait + optional indexmap). +[dependencies] +stable_deref_trait = "1.1.1" +indexmap = { version = "2.0.2", optional = true } +EOF + +mkdir -p "${PREFETCH_DIR}/src" +printf 'pub fn placeholder() {}\n' > "${PREFETCH_DIR}/src/lib.rs" + +# Populate the shared CARGO_HOME registry cache with every crate the offline build needs. +# Using --manifest-path guarantees cargo resolves against the generated manifest only. +cargo fetch --manifest-path "${PREFETCH_DIR}/Cargo.toml" + +# Export the offline flag so build.sh never attempts network resolution. +export CARGO_NET_OFFLINE="true" + +# Clean up the temporary prefetch directory (cache already lives in CARGO_HOME). +rm -rf "${PREFETCH_DIR}" diff --git a/manishearth--elsa.91944aa/tests/executable b/manishearth--elsa.91944aa/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..60b8c0b92937f5d8e418eefd864fbe32ff416bb5 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d4364f85ada7cf22ae6026e7ca51c5431d7e7b7c3a122a237d145f221cc01dc +size 448784 diff --git a/manishearth--elsa.91944aa/tests/harbor_prepare_download_env.sh b/manishearth--elsa.91944aa/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/manishearth--elsa.91944aa/tests/programgym_evaluator.py b/manishearth--elsa.91944aa/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/manishearth--elsa.91944aa/tests/programgym_task.json b/manishearth--elsa.91944aa/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..fa4467b31165c1e0fd7fdfac65485a8c6a6dfe49 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/programgym_task.json @@ -0,0 +1,355 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_arena.test_all_friend_edges_cross_check_counts", + "eval.tests.test_arena.test_behavior_stable_across_environment[addl_env0]", + "eval.tests.test_arena.test_behavior_stable_across_environment[addl_env1]", + "eval.tests.test_arena.test_behavior_stable_across_environment[addl_env2]", + "eval.tests.test_arena.test_behavior_stable_across_environment[addl_env3]", + "eval.tests.test_arena.test_best_friend_lists_only_lonely", + "eval.tests.test_arena.test_dump_iterates_arena_in_push_order", + "eval.tests.test_arena.test_dump_parses_to_expected_friend_graph", + "eval.tests.test_arena.test_each_pushed_thing_header_appears_exactly_once", + "eval.tests.test_arena.test_each_thing_friend_list_is_exact[best friend-expected_friends1]", + "eval.tests.test_arena.test_each_thing_friend_list_is_exact[facebook-expected_friends4]", + "eval.tests.test_arena.test_each_thing_friend_list_is_exact[lonely-expected_friends0]", + "eval.tests.test_arena.test_each_thing_friend_list_is_exact[rando-expected_friends3]", + "eval.tests.test_arena.test_each_thing_friend_list_is_exact[threes a crowd-expected_friends2]", + "eval.tests.test_arena.test_every_header_ends_with_colon", + "eval.tests.test_arena.test_every_profiled_thing_appears_in_dump[best friend]", + "eval.tests.test_arena.test_every_profiled_thing_appears_in_dump[facebook]", + "eval.tests.test_arena.test_every_profiled_thing_appears_in_dump[lonely]", + "eval.tests.test_arena.test_every_profiled_thing_appears_in_dump[rando]", + "eval.tests.test_arena.test_every_profiled_thing_appears_in_dump[threes a crowd]", + "eval.tests.test_arena.test_exit_code_zero_and_real_output", + "eval.tests.test_arena.test_facebook_edges_cover_all_other_things", + "eval.tests.test_arena.test_facebook_friend_list_full_and_ordered", + "eval.tests.test_arena.test_first_line_is_first_thing_header", + "eval.tests.test_arena.test_friend_lines_are_exactly_tab_prefixed", + "eval.tests.test_arena.test_friends_are_distinct_prior_things", + "eval.tests.test_arena.test_golden_is_a_real_fixture_and_matches_real_output", + "eval.tests.test_arena.test_grade_headers_lines", + "eval.tests.test_arena.test_last_line_is_best_friend_friend", + "eval.tests.test_arena.test_lone_things_have_empty_friend_lists_singleton_lonely", + "eval.tests.test_arena.test_lone_things_have_empty_friend_lists_singleton_rando", + "eval.tests.test_arena.test_output_line_count_is_exact", + "eval.tests.test_arena.test_programgym_executable_path_points_at_runnable_file", + "eval.tests.test_arena.test_programgym_executable_runs_and_produces_golden", + "eval.tests.test_arena.test_stderr_empty", + "eval.tests.test_arena.test_stdin_has_no_effect_on_output[\\n]", + "eval.tests.test_arena.test_stdin_has_no_effect_on_output[]", + "eval.tests.test_arena.test_stdin_has_no_effect_on_output[data\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\ndata\\n]", + "eval.tests.test_arena.test_stdin_has_no_effect_on_output[x\\n]", + "eval.tests.test_arena.test_stdout_deterministic_octet_for_octet", + "eval.tests.test_arena.test_stdout_exactly_matches_golden[extra0]", + "eval.tests.test_arena.test_stdout_exactly_matches_golden[extra1]", + "eval.tests.test_arena.test_stdout_exactly_matches_golden[extra2]", + "eval.tests.test_arena.test_stdout_exactly_matches_golden[extra3]", + "eval.tests.test_arena.test_stdout_identical_across_repeated_invocations", + "eval.tests.test_arena.test_stdout_matches_golden_base_guard", + "eval.tests.test_arena.test_tab_indented_friend_lines", + "eval.tests.test_arena.test_threes_a_crowd_friends_preserve_order", + "eval.tests.test_arena.test_works_from_different_working_directories" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_arena_additional_surfaces.test_concurrent_runs_produce_pairwise_identical_bytes", + "eval.tests.test_arena_additional_surfaces.test_every_entry_has_a_forward_section", + "eval.tests.test_arena_additional_surfaces.test_identical_output_across_concurrent_processes", + "eval.tests.test_arena_additional_surfaces.test_no_entry_references_itself", + "eval.tests.test_arena_additional_surfaces.test_output_stable_under_combined_input_perturbation[flag_and_nul_stdin]", + "eval.tests.test_arena_additional_surfaces.test_output_stable_under_combined_input_perturbation[four_args_unicode_stdin]", + "eval.tests.test_arena_additional_surfaces.test_output_stable_under_combined_input_perturbation[help_and_stdin]", + "eval.tests.test_arena_additional_surfaces.test_output_stable_under_combined_input_perturbation[version_and_binary_stdin]", + "eval.tests.test_arena_additional_surfaces.test_regular_file_sink_preserves_full_trailing_terminator", + "eval.tests.test_arena_additional_surfaces.test_regular_file_sinks_stdout_and_stderr_are_split_correctly", + "eval.tests.test_arena_additional_surfaces.test_reverse_dependency_degree_exact", + "eval.tests.test_arena_additional_surfaces.test_stdout_into_regular_file_is_golden_exact", + "eval.tests.test_arena_canonical.test_canonical_dump_is_byte_exact_golden", + "eval.tests.test_arena_canonical.test_dump_is_182_bytes", + "eval.tests.test_arena_canonical.test_dump_is_line_count_12", + "eval.tests.test_arena_canonical.test_no_environment_dependency", + "eval.tests.test_arena_canonical.test_only_ascii_printable_in_output", + "eval.tests.test_arena_canonical.test_run_ignores_current_working_directory", + "eval.tests.test_arena_canonical.test_stderr_is_empty_on_normal_path", + "eval.tests.test_arena_canonical.test_stdout_ends_with_single_trailing_newline", + "eval.tests.test_arena_canonical.test_success_reports_empty_stderr_and_zero_exit", + "eval.tests.test_arena_canonical.test_tab_indentation_of_friend_entries", + "eval.tests.test_arena_determinism.test_identical_output_across_many_runs", + "eval.tests.test_arena_determinism.test_identical_output_across_two_runs", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[1024]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[16]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[1]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[256]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[2]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[4]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[64]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_count[8]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[eight_positionals]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[flag_equals_value]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[help_flag]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[no_args]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[non_ascii]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[short_help]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[single_arg]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[single_empty]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[three_empty]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[two_known_words]", + "eval.tests.test_arena_determinism.test_output_independent_of_argument_list[version_flag]", + "eval.tests.test_arena_determinism.test_output_independent_of_closed_stdin", + "eval.tests.test_arena_determinism.test_output_independent_of_odd_arguments[inline_args0]", + "eval.tests.test_arena_determinism.test_output_independent_of_odd_arguments[inline_args1]", + "eval.tests.test_arena_determinism.test_output_independent_of_odd_arguments[inline_args2]", + "eval.tests.test_arena_determinism.test_output_independent_of_odd_arguments[inline_args3]", + "eval.tests.test_arena_determinism.test_output_independent_of_randomish_args[0]", + "eval.tests.test_arena_determinism.test_output_independent_of_randomish_args[1]", + "eval.tests.test_arena_determinism.test_output_independent_of_randomish_args[42]", + "eval.tests.test_arena_determinism.test_output_independent_of_randomish_args[999999]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[all_byte_values]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[ascii_100kb]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[ascii_1mib]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[embedded_nul]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[empty]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[multi_line]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[newline_only]", + "eval.tests.test_arena_determinism.test_output_independent_of_stdin[one_line]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_complete_extra_env", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[columns_40]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[home_missing]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[lines_24]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[long_custom_var]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[no_color]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[path_empty]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[rust_backtrace_on]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[rust_log_trace]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[term_256color]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[term_vt100]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[tz_empty]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[tz_new_york]", + "eval.tests.test_arena_environment_matrix.test_output_identical_under_extra_environment_key[xdg_cache_missing]", + "eval.tests.test_arena_error_path.test_broken_pipe_panics_with_101", + "eval.tests.test_arena_error_path.test_broken_pipe_yields_panic_diagnostic", + "eval.tests.test_arena_error_path.test_panic_message_mentions_stdout", + "eval.tests.test_arena_error_path.test_stdout_capture_exit_zero_is_golden_exact", + "eval.tests.test_arena_error_path.test_stdout_to_a_seekable_capture_is_golden_exact", + "eval.tests.test_arena_error_path.test_stdout_to_dev_full_panics_with_101", + "eval.tests.test_arena_graph_closure.test_forward_transitive_closure_exact", + "eval.tests.test_arena_graph_closure.test_full_ordered_edge_multiset_exact", + "eval.tests.test_arena_graph_closure.test_graph_is_one_weakly_connected_component", + "eval.tests.test_arena_graph_closure.test_leaf_and_branch_partition_exact", + "eval.tests.test_arena_graph_closure.test_reverse_transitive_closure_exact", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=C.UTF-8_lcall=C.UTF-8]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=C_lcall=C]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=POSIX_lcall=POSIX]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=de_DE.UTF-8_lcall=de_DE.UTF-8]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=en_US.UTF-8_lcall=en_US.UTF-8]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=ja_JP.UTF-8_lcall=ja_JP.UTF-8]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=tr_TR.UTF-8_lcall=tr_TR.UTF-8]", + "eval.tests.test_arena_locale_independence.test_output_identical_under_each_locale[lang=unset_lcall=unset]", + "eval.tests.test_arena_locale_independence.test_output_identical_with_minimal_environment", + "eval.tests.test_arena_locale_independence.test_output_identical_with_unset_locale_vars", + "eval.tests.test_arena_structure.test_best_friend_friends", + "eval.tests.test_arena_structure.test_every_friend_is_a_known_entry", + "eval.tests.test_arena_structure.test_every_section_present", + "eval.tests.test_arena_structure.test_facebook_direct_and_indirect_lonely_reference", + "eval.tests.test_arena_structure.test_facebook_friends_ordered", + "eval.tests.test_arena_structure.test_lonely_has_no_friends", + "eval.tests.test_arena_structure.test_no_duplicate_friends_within_an_entry", + "eval.tests.test_arena_structure.test_rando_has_no_friends", + "eval.tests.test_arena_structure.test_section_set_and_order", + "eval.tests.test_arena_structure.test_threes_a_crowd_friends", + "eval.tests.test_arena_structure.test_total_friend_reference_count", + "eval.tests.test_golden_integrity.test_environment_variable_points_to_running_executable", + "eval.tests.test_golden_integrity.test_golden_file_exists_and_equals_run", + "eval.tests.test_golden_integrity.test_golden_is_binary_stable_bytes", + "eval.tests.test_golden_integrity.test_golden_line_shapes_match_run", + "eval.tests.test_golden_integrity.test_golden_matches_runtime_output" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_arena_behavior.test_header_line_adjacency_invariant", + "reasons": [ + { + "id": "if_else_both_assert", + "message": "pytest test asserts different outcomes in both if and else branches", + "path": "eval/tests/test_arena_behavior.py", + "repair_hint": "Remove nondeterministic branching and assert one deterministic expected behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_arena_behavior.test_all_friend_names_are_known_things", + "eval.tests.test_arena_behavior.test_args_plus_stdin_combined_tolerated", + "eval.tests.test_arena_behavior.test_best_friend_owns_lonely_only", + "eval.tests.test_arena_behavior.test_binary_completes_embedded_selfchecks_without_panic", + "eval.tests.test_arena_behavior.test_binary_invalid_utf8_stdin_tolerated", + "eval.tests.test_arena_behavior.test_common_version_and_repo_flags_ignored", + "eval.tests.test_arena_behavior.test_dash_passthrough_arg_tolerated", + "eval.tests.test_arena_behavior.test_double_dash_separator_tolerated", + "eval.tests.test_arena_behavior.test_each_header_present_exactly_once", + "eval.tests.test_arena_behavior.test_empty_and_whitespace_positional_ignored", + "eval.tests.test_arena_behavior.test_empty_stdin_ignored", + "eval.tests.test_arena_behavior.test_every_thing_name_has_a_header", + "eval.tests.test_arena_behavior.test_exact_byte_offset_of_each_header_in_stream", + "eval.tests.test_arena_behavior.test_exact_per_line_byte_length_sequence", + "eval.tests.test_arena_behavior.test_explicit_stdin_ignored", + "eval.tests.test_arena_behavior.test_facebook_links_all_three_isolates_in_order", + "eval.tests.test_arena_behavior.test_facebook_owns_four_friends_in_order", + "eval.tests.test_arena_behavior.test_final_friend_entry_at_known_byte_offset", + "eval.tests.test_arena_behavior.test_friend_count_total_is_seven", + "eval.tests.test_arena_behavior.test_friend_entries_indented_with_single_tab", + "eval.tests.test_arena_behavior.test_friend_entries_single_tab_no_trailing_space", + "eval.tests.test_arena_behavior.test_friend_entry_name_multiplicity", + "eval.tests.test_arena_behavior.test_friend_header_no_duplicates", + "eval.tests.test_arena_behavior.test_header_line_adjacency_invariant", + "eval.tests.test_arena_behavior.test_headers_have_no_leading_whitespace", + "eval.tests.test_arena_behavior.test_help_flag_produces_program_output_not_help_text", + "eval.tests.test_arena_behavior.test_kv_flag_forms_produce_golden_output", + "eval.tests.test_arena_behavior.test_large_stdin_ignored", + "eval.tests.test_arena_behavior.test_lonely_has_no_friends", + "eval.tests.test_arena_behavior.test_many_positional_args_tolerated", + "eval.tests.test_arena_behavior.test_multi_flag_and_positional_mix_ignored", + "eval.tests.test_arena_behavior.test_multiple_positional_args_tolerated", + "eval.tests.test_arena_behavior.test_no_carriage_returns_no_crlf", + "eval.tests.test_arena_behavior.test_no_double_tab_or_misindented_entries", + "eval.tests.test_arena_behavior.test_no_empty_friend_header", + "eval.tests.test_arena_behavior.test_no_filesystem_data_output", + "eval.tests.test_arena_behavior.test_only_expected_stdout_no_env_leak", + "eval.tests.test_arena_behavior.test_output_byte_length_invariant_under_inert_inputs", + "eval.tests.test_arena_behavior.test_output_identical_across_three_runs", + "eval.tests.test_arena_behavior.test_output_identical_across_varied_env_tolerance", + "eval.tests.test_arena_behavior.test_plain_run_exit_code_zero", + "eval.tests.test_arena_behavior.test_plain_run_nonempty_stdout", + "eval.tests.test_arena_behavior.test_plain_stdout_ends_with_newline", + "eval.tests.test_arena_behavior.test_positional_args_tolerated", + "eval.tests.test_arena_behavior.test_rando_has_no_friends", + "eval.tests.test_arena_behavior.test_runs_without_hanging", + "eval.tests.test_arena_behavior.test_short_flag_tolerated", + "eval.tests.test_arena_behavior.test_single_trailing_newline_no_extra_blank_lines", + "eval.tests.test_arena_behavior.test_stdout_byte_length_equals_golden_payload_size", + "eval.tests.test_arena_behavior.test_stdout_ends_with_best_friend_entry", + "eval.tests.test_arena_behavior.test_stdout_has_expected_line_count", + "eval.tests.test_arena_behavior.test_stdout_identical_across_distinct_working_dirs", + "eval.tests.test_arena_behavior.test_stdout_identical_under_extra_environment_vars", + "eval.tests.test_arena_behavior.test_stdout_is_pure_ascii_encoding", + "eval.tests.test_arena_behavior.test_stdout_matches_golden_exactly", + "eval.tests.test_arena_behavior.test_stdout_starts_with_first_header", + "eval.tests.test_arena_behavior.test_threes_a_crowd_owns_lonely_then_best_friend", + "eval.tests.test_arena_behavior.test_top_level_thing_preserves_insertion_order", + "eval.tests.test_arena_behavior.test_unicode_positional_args_tolerated" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_frozenvec_arena.test_arena_dump_encodes_stable_reference_invariants", + "eval.tests.test_frozenvec_arena.test_arena_dump_stdout_matches_golden" + ] + } + }, + "commit": "91944aacda886a054a8e3ba9aa91c73ea04de96c", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9405662864900903, + "eval_clean_hashes": [ + "7d4364f85ada7cf22ae6026e7ca51c5431d7e7b7c3a122a237d145f221cc01dc" + ], + "input_record": { + "codeql_db_mb": 84.5, + "codeql_status": true, + "codeql_time": 47.86985057173297, + "commit": "91944aacda886a054a8e3ba9aa91c73ea04de96c", + "commits": 225, + "contributors": 30, + "difficulty": "easy", + "difficulty_code_lines": 2907, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 2907, + "difficulty_runtime_deps": 2, + "difficulty_score": 1.9405662864900903, + "difficulty_test_code_lines": 339, + "full_name": "Manishearth/elsa", + "github_stars": 280, + "input_codeql_db": "rust_codeql/Manishearth__elsa", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "cordx56/rustowl", + "rank": 936, + "similarity": 0.5730253458023071 + } + ], + "repo_age": 7.62, + "repo_path": "rust/Manishearth__elsa", + "rust_channel": "stable", + "rust_edition": "2018", + "rust_release_date": "2018-12-06", + "rust_version": "1.31.0", + "rust_version_source": "edition", + "source": "commit:91944aacda886a054a8e3ba9aa91c73ea04de96c", + "status": "done", + "url": "https://github.com/Manishearth/elsa" + }, + "instance_id": "Manishearth__elsa.91944aa", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 1, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 5, + "module_kind": "tests", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "Manishearth/elsa" +} diff --git a/manishearth--elsa.91944aa/tests/test.sh b/manishearth--elsa.91944aa/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/manishearth--elsa.91944aa/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/manishearth--elsa.91944aa/tests/workspace.tar.gz b/manishearth--elsa.91944aa/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..afb29ccc5b46315dcccba7ee73eebe7fa4726b72 --- /dev/null +++ b/manishearth--elsa.91944aa/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9422238df6471cf41d6001deb6becfa4d7ad14e6097dbb4f02e40fe70308fbd +size 2053 diff --git a/mapbox--protozero.203aa15/environment/Dockerfile b/mapbox--protozero.203aa15/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/mapbox--protozero.203aa15/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mapbox--protozero.203aa15/environment/docker-compose.yaml b/mapbox--protozero.203aa15/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mapbox--protozero.203aa15/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mapbox--protozero.203aa15/environment/download.sh b/mapbox--protozero.203aa15/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b709a79261fe9c028d8a2b2316c89471ef71aea --- /dev/null +++ b/mapbox--protozero.203aa15/environment/download.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# ProgramGym download stage for protozero. +# +# protozero is a header-only C++ library. The selected target 'pbf-decoder' +# (tools/pbf-decoder.cpp) depends only on: +# - the C++14 compiler toolchain (g++/gcc 13) [present in base image] +# - CMake 3.31 [present in base image] +# - make 4.3 [present in base image] +# - getopt() from glibc [present in base image] +# - the public protozero headers shipped in the repository include/ tree +# +# Therefore no third-party dependencies, source archives, or package-manager +# prefetches are required for the offline build. This script is intentionally +# a no-op: it only exports the environment variable that build.sh relies on and +# performs no compile, link, test, or packaging step. +# +# It is safe to source from the repository root (source /source_ro/download.sh) +# and to run idempotently. It must not read any repository source file. + +# The build will be run from the repository root after the pipeline copies it +# into /workspace/source. Export the intended build directory so build.sh and +# this script agree on where the offline artifacts land. +export PROTOZERO_BUILD_DIR="build" + +# Nothing to download, install, or prefetch for this header-only dependency +# closure. Report success and return. +echo "download.sh: protozero is header-only with no third-party dependencies to fetch." + +# Bash version: 5.1 diff --git a/mapbox--protozero.203aa15/environment/executable b/mapbox--protozero.203aa15/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..277bff441deec6aaeb3db30ece9e994c591e01e6 --- /dev/null +++ b/mapbox--protozero.203aa15/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13f9706c4df52a8c893a15745506a6d1b149d126fa26f227e756a0253463b9fb +size 2830864 diff --git a/mapbox--protozero.203aa15/environment/harbor_configure_apt_mirror.sh b/mapbox--protozero.203aa15/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mapbox--protozero.203aa15/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mapbox--protozero.203aa15/environment/harbor_prepare_download_env.sh b/mapbox--protozero.203aa15/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mapbox--protozero.203aa15/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mapbox--protozero.203aa15/environment/workspace.tar.gz b/mapbox--protozero.203aa15/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e42a0133b1232a5df2482d713a009243c95106db --- /dev/null +++ b/mapbox--protozero.203aa15/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a99a98a2356a69416dfe64ba2cd2579c655a3ef73f61db42a978108b88eed06 +size 2562 diff --git a/mapbox--protozero.203aa15/instruction.md b/mapbox--protozero.203aa15/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mapbox--protozero.203aa15/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mapbox--protozero.203aa15/solution/solve.sh b/mapbox--protozero.203aa15/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mapbox--protozero.203aa15/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mapbox--protozero.203aa15/task.toml b/mapbox--protozero.203aa15/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..48f5be9fd2bb1bb4c2c6b1b62b5f5e9a71840f03 --- /dev/null +++ b/mapbox--protozero.203aa15/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mapbox--protozero.203aa15" +description = "Synthetic ProgramGym cleanroom reconstruction task for mapbox/protozero" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "mapbox__protozero.203aa15" +repository = "mapbox/protozero" +commit = "203aa1536e5637d5f09df113a5ddc9559e17f375" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.9787281771384917 +test_branches = 4 +test_count = 724 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mapbox--protozero.203aa15/tests/Dockerfile b/mapbox--protozero.203aa15/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/mapbox--protozero.203aa15/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_01.tar.gz b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..db4fe8bcb5b8ee2d2c9c002192117c679f75a9fd --- /dev/null +++ b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a5027ec546f9d77082d8bd9ca13dc91aba54ff19cfb6ca75992d71423d51265 +size 9658 diff --git a/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_02.tar.gz b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..727915db8aaec7c7033e41b8b3b76f4ee2b6ba95 --- /dev/null +++ b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fffca13fab35f2dd2163ae5c6556fe25ae85933b4721babf46a7bfb3507e6025 +size 13695 diff --git a/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_03.tar.gz b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1662a4eefa28380d25bc3d10635e4925edb2d021 --- /dev/null +++ b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73f185e1046ed2bf9f2eb15167190a9ded3b94a61464ea6c425bc9baf85554c5 +size 12670 diff --git a/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_04.tar.gz b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4fed65e96674b48accb23a84cc77d6d2ed2e1cdc --- /dev/null +++ b/mapbox--protozero.203aa15/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3d5bd95c23ea8bd7e000dbd66da57ad4db474399eab1dd53dd6aa1aaa50c486 +size 22282 diff --git a/mapbox--protozero.203aa15/tests/blobs/tests/generated_upstream.tar.gz b/mapbox--protozero.203aa15/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7897b57a802497d736a76ffc27fc1dcb14ffea76 --- /dev/null +++ b/mapbox--protozero.203aa15/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:627a868fb4202a6002f65ab9b09b69f36924b6992163564454185c073caf4364 +size 570922 diff --git a/mapbox--protozero.203aa15/tests/docker-compose.yaml b/mapbox--protozero.203aa15/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mapbox--protozero.203aa15/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mapbox--protozero.203aa15/tests/download.sh b/mapbox--protozero.203aa15/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b709a79261fe9c028d8a2b2316c89471ef71aea --- /dev/null +++ b/mapbox--protozero.203aa15/tests/download.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# ProgramGym download stage for protozero. +# +# protozero is a header-only C++ library. The selected target 'pbf-decoder' +# (tools/pbf-decoder.cpp) depends only on: +# - the C++14 compiler toolchain (g++/gcc 13) [present in base image] +# - CMake 3.31 [present in base image] +# - make 4.3 [present in base image] +# - getopt() from glibc [present in base image] +# - the public protozero headers shipped in the repository include/ tree +# +# Therefore no third-party dependencies, source archives, or package-manager +# prefetches are required for the offline build. This script is intentionally +# a no-op: it only exports the environment variable that build.sh relies on and +# performs no compile, link, test, or packaging step. +# +# It is safe to source from the repository root (source /source_ro/download.sh) +# and to run idempotently. It must not read any repository source file. + +# The build will be run from the repository root after the pipeline copies it +# into /workspace/source. Export the intended build directory so build.sh and +# this script agree on where the offline artifacts land. +export PROTOZERO_BUILD_DIR="build" + +# Nothing to download, install, or prefetch for this header-only dependency +# closure. Report success and return. +echo "download.sh: protozero is header-only with no third-party dependencies to fetch." + +# Bash version: 5.1 diff --git a/mapbox--protozero.203aa15/tests/executable b/mapbox--protozero.203aa15/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..277bff441deec6aaeb3db30ece9e994c591e01e6 --- /dev/null +++ b/mapbox--protozero.203aa15/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13f9706c4df52a8c893a15745506a6d1b149d126fa26f227e756a0253463b9fb +size 2830864 diff --git a/mapbox--protozero.203aa15/tests/harbor_configure_apt_mirror.sh b/mapbox--protozero.203aa15/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mapbox--protozero.203aa15/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mapbox--protozero.203aa15/tests/harbor_prepare_download_env.sh b/mapbox--protozero.203aa15/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mapbox--protozero.203aa15/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mapbox--protozero.203aa15/tests/programgym_evaluator.py b/mapbox--protozero.203aa15/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mapbox--protozero.203aa15/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mapbox--protozero.203aa15/tests/programgym_task.json b/mapbox--protozero.203aa15/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..403aef23296e13e9b9048d86d568fec63de4b4fc --- /dev/null +++ b/mapbox--protozero.203aa15/tests/programgym_task.json @@ -0,0 +1,834 @@ +{ + "branches": { + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_advanced.test_empty_field_then_varint_sibling", + "eval.tests.test_advanced.test_field_number_overflow_reads_as_tag_zero", + "eval.tests.test_advanced.test_large_positive_varint_followed_by_field", + "eval.tests.test_advanced.test_length_delimited_consumption_does_not_affect_next", + "eval.tests.test_advanced.test_many_fields_sequential_read", + "eval.tests.test_advanced.test_maximum_field_number_decodes", + "eval.tests.test_advanced.test_nested_message_then_sibling_field", + "eval.tests.test_advanced.test_repeated_same_tag_length_delimited", + "eval.tests.test_advanced.test_varint_too_ten_bytes_overflow", + "eval.tests.test_cli.test_file_input", + "eval.tests.test_cli.test_file_input_with_data_dir", + "eval.tests.test_cli.test_help_after_read_options_wins", + "eval.tests.test_cli.test_help_long_opt_exit_zero", + "eval.tests.test_cli.test_help_long_output_exact", + "eval.tests.test_cli.test_help_short_opt_output_content", + "eval.tests.test_cli.test_help_with_positional_still_shows_help", + "eval.tests.test_cli.test_length_greater_than_file", + "eval.tests.test_cli.test_length_long_equals_same_result", + "eval.tests.test_cli.test_length_negative_value_is_capped_no_truncate", + "eval.tests.test_cli.test_length_non_numeric_value_reads_nothing", + "eval.tests.test_cli.test_length_option_missing_argument", + "eval.tests.test_cli.test_length_truncates_read", + "eval.tests.test_cli.test_length_truncates_to_boundary", + "eval.tests.test_cli.test_length_zero_reads_nothing", + "eval.tests.test_cli.test_long_option_form_length", + "eval.tests.test_cli.test_missing_file_reads_empty", + "eval.tests.test_cli.test_no_args_prints_usage_exit_1", + "eval.tests.test_cli.test_offset_at_key_boundary_decodes", + "eval.tests.test_cli.test_offset_end_of_available_data", + "eval.tests.test_cli.test_offset_exact_size_is_empty_message", + "eval.tests.test_cli.test_offset_larger_than_file_errors", + "eval.tests.test_cli.test_offset_negative_value_reports_larger_than_file", + "eval.tests.test_cli.test_offset_non_numeric_value_is_no_shift", + "eval.tests.test_cli.test_offset_one_byte_before_end_truncates_key", + "eval.tests.test_cli.test_offset_option_missing_argument", + "eval.tests.test_cli.test_offset_zero_same_as_none", + "eval.tests.test_cli.test_stdin_dash_reads_input", + "eval.tests.test_cli.test_stdin_dash_then_file", + "eval.tests.test_cli.test_two_positional_args_rejected", + "eval.tests.test_cli.test_unknown_long_option_rejected", + "eval.tests.test_cli.test_unknown_short_option_exit_1", + "eval.tests.test_combinatorial.test_long_printable_string_truncated_at_60", + "eval.tests.test_combinatorial.test_non_message_printable_beats_packed", + "eval.tests.test_combinatorial.test_packed_double_nan_not_last", + "eval.tests.test_combinatorial.test_packed_double_negative_and_huge", + "eval.tests.test_combinatorial.test_packed_float_single_value", + "eval.tests.test_combinatorial.test_packed_float_with_nan_and_negative", + "eval.tests.test_combinatorial.test_packed_single_non_printable_leaks_and_dumps", + "eval.tests.test_combinatorial.test_packed_varint_midway_throw_leaks_prefix", + "eval.tests.test_combinatorial.test_packed_varint_multibyte_values", + "eval.tests.test_combinatorial.test_packed_varint_negative_after_positive", + "eval.tests.test_combinatorial.test_packed_varint_overlong_falls_back_to_string", + "eval.tests.test_combinatorial.test_packed_varint_single_byte_value", + "eval.tests.test_combinatorial.test_packed_varint_single_large_uint32", + "eval.tests.test_combinatorial.test_packed_varint_threw_after_printable_byte", + "eval.tests.test_combinatorial.test_packed_varint_two_prefix_then_dot", + "eval.tests.test_combinatorial.test_packed_varint_uint64max_reads_neg_one", + "eval.tests.test_combinatorial.test_packed_varint_with_zeroes_mixed", + "eval.tests.test_combinatorial.test_valid_message_precedes_string_and_packed", + "eval.tests.test_decoding.test_double_field1[-1.0-1: -1]", + "eval.tests.test_decoding.test_double_field1[0.0-1: 0]", + "eval.tests.test_decoding.test_double_field1[1.0-1: 1]", + "eval.tests.test_decoding.test_double_field1[1.5e-300-1: 1.5e-300]", + "eval.tests.test_decoding.test_double_field1[1e+100-1: 1e+100]", + "eval.tests.test_decoding.test_double_field1[3.14-1: 3.14]", + "eval.tests.test_decoding.test_double_nan", + "eval.tests.test_decoding.test_double_negative_infinity", + "eval.tests.test_decoding.test_double_positive_infinity", + "eval.tests.test_decoding.test_duplicate_field_numbers", + "eval.tests.test_decoding.test_empty_message_produces_no_output", + "eval.tests.test_decoding.test_field_numbers_out_of_order", + "eval.tests.test_decoding.test_float_field1[-0.5-1: -0.5]", + "eval.tests.test_decoding.test_float_field1[0.0-1: 0]", + "eval.tests.test_decoding.test_float_field1[1.5-1: 1.5]", + "eval.tests.test_decoding.test_float_field1[3.4028235e+38-1: 3.40282e+38]", + "eval.tests.test_decoding.test_half_length_delimited_field_truncation", + "eval.tests.test_decoding.test_large_field_number_tag", + "eval.tests.test_decoding.test_mixed_wire_types_in_one_message", + "eval.tests.test_decoding.test_multiple_varint_fields_summed_order", + "eval.tests.test_decoding.test_reserved_tag_range_rejected[19000]", + "eval.tests.test_decoding.test_reserved_tag_range_rejected[19001]", + "eval.tests.test_decoding.test_reserved_tag_range_rejected[19999]", + "eval.tests.test_decoding.test_tag_at_lower_reserved_boundary", + "eval.tests.test_decoding.test_tag_just_above_reserved_range_ok", + "eval.tests.test_decoding.test_tag_zero_rejected", + "eval.tests.test_decoding.test_truncated_fixed32_missing_bytes", + "eval.tests.test_decoding.test_truncated_fixed64_missing_bytes", + "eval.tests.test_decoding.test_truncated_key_only", + "eval.tests.test_decoding.test_truncated_length_delimited_missing_payload", + "eval.tests.test_decoding.test_truncated_varint_continuation", + "eval.tests.test_decoding.test_unknown_wire_type_rejected[11]", + "eval.tests.test_decoding.test_unknown_wire_type_rejected[12]", + "eval.tests.test_decoding.test_unknown_wire_type_rejected[14]", + "eval.tests.test_decoding.test_unknown_wire_type_rejected[15]", + "eval.tests.test_decoding.test_unknown_wire_type_with_tag_zero_is_invalid_tag", + "eval.tests.test_decoding.test_varint_bool_false_decodes_as_0", + "eval.tests.test_decoding.test_varint_bool_true_decodes_as_1", + "eval.tests.test_decoding.test_varint_enum_max_value", + "eval.tests.test_decoding.test_varint_multi_byte_max", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-1--1]", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-127--127]", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-128--128]", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-2--2]", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-2147483648--2147483648]", + "eval.tests.test_decoding.test_varint_negative_int64_two_complement[-9223372036854775808--9223372036854775808]", + "eval.tests.test_decoding.test_varint_positive_field1[0-1: 0]", + "eval.tests.test_decoding.test_varint_positive_field1[1-1: 1]", + "eval.tests.test_decoding.test_varint_positive_field1[127-1: 127]", + "eval.tests.test_decoding.test_varint_positive_field1[128-1: 128]", + "eval.tests.test_decoding.test_varint_positive_field1[2147483647-1: 2147483647]", + "eval.tests.test_decoding.test_varint_positive_field1[300-1: 300]", + "eval.tests.test_decoding.test_varint_positive_field1[9223372036854775807-1: 9223372036854775807]", + "eval.tests.test_decoding.test_varint_uint64_max_reads_as_negative", + "eval.tests.test_length_delimited.test_deep_nested_message_same_tag", + "eval.tests.test_length_delimited.test_empty_length_delimited_field", + "eval.tests.test_length_delimited.test_long_printable_string_exactly_truncation_boundary", + "eval.tests.test_length_delimited.test_long_printable_string_truncated", + "eval.tests.test_length_delimited.test_multiple_non_printable_bytes_substituted", + "eval.tests.test_length_delimited.test_nested_message_multiple_fields", + "eval.tests.test_length_delimited.test_nested_message_single_varint", + "eval.tests.test_length_delimited.test_non_printable_varint_failure_falls_back_to_string", + "eval.tests.test_length_delimited.test_packed_double_non_full_length_is_float", + "eval.tests.test_length_delimited.test_packed_double_single_nan", + "eval.tests.test_length_delimited.test_packed_double_values[values0-1.5,2.5]", + "eval.tests.test_length_delimited.test_packed_double_values[values1-1]", + "eval.tests.test_length_delimited.test_packed_double_values[values2--1.5,3.25]", + "eval.tests.test_length_delimited.test_packed_double_values[values3-0,0,0]", + "eval.tests.test_length_delimited.test_packed_float_values[values0-1.5]", + "eval.tests.test_length_delimited.test_packed_float_values[values1-1.5,2.5,3.25]", + "eval.tests.test_length_delimited.test_packed_float_values[values2-0,0,0]", + "eval.tests.test_length_delimited.test_packed_varint_alignment_four_is_float", + "eval.tests.test_length_delimited.test_packed_varint_negative_reads_via_int64", + "eval.tests.test_length_delimited.test_packed_varint_values[values0-1,2]", + "eval.tests.test_length_delimited.test_packed_varint_values[values1-1,2,3]", + "eval.tests.test_length_delimited.test_packed_varint_values[values2-100,200,300,400]", + "eval.tests.test_length_delimited.test_packed_varint_values[values3-9223372036854775807]", + "eval.tests.test_length_delimited.test_printable_string_decoded[-]", + "eval.tests.test_length_delimited.test_printable_string_decoded[A:B_-\"A:B_\"]", + "eval.tests.test_length_delimited.test_printable_string_decoded[a-\"a\"]", + "eval.tests.test_length_delimited.test_printable_string_decoded[foobar-\"foobar\"]", + "eval.tests.test_length_delimited.test_printable_string_decoded[hello_world-123-\"hello_world-123\"]", + "eval.tests.test_length_delimited.test_printable_string_under_limit_untouched", + "eval.tests.test_length_delimited.test_two_floats_eight_bytes_decoded_as_double", + "eval.tests.test_length_delimited.test_two_level_nested_message" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_double_dash_separator", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_missing_length_value_usage_error", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_missing_offset_value_usage_error", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_negative_offset_errors", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_non_numeric_length_reads_zero", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_non_numeric_offset_reads_zero", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_repeated_length_last_wins", + "eval.tests.test_cli_io.TestArgumentParsingEdgeCases.test_repeated_offset_last_wins", + "eval.tests.test_cli_io.TestHelp.test_help_ignores_file_argument", + "eval.tests.test_cli_io.TestHelp.test_help_prints_usage[long]", + "eval.tests.test_cli_io.TestHelp.test_help_prints_usage[short]", + "eval.tests.test_cli_io.TestLengthOption.test_length_mid_varint_errors", + "eval.tests.test_cli_io.TestLengthOption.test_length_short_form", + "eval.tests.test_cli_io.TestLengthOption.test_length_truncates_to_single_field", + "eval.tests.test_cli_io.TestOffsetAndLengthTogether.test_length_greater_than_remaining_is_noop", + "eval.tests.test_cli_io.TestOffsetAndLengthTogether.test_offset_then_length", + "eval.tests.test_cli_io.TestOffsetOption.test_offset_aligned_to_field_start", + "eval.tests.test_cli_io.TestOffsetOption.test_offset_inside_field_errors", + "eval.tests.test_cli_io.TestOffsetOption.test_offset_lands_on_length_delimited_nested", + "eval.tests.test_cli_io.TestOffsetOption.test_offset_short_form_flag", + "eval.tests.test_cli_io.TestOffsetOption.test_offset_skips_leading_field", + "eval.tests.test_cli_io.TestStdin.test_stdin_empty", + "eval.tests.test_cli_io.TestStdin.test_stdin_multiple_fields", + "eval.tests.test_cli_io.TestStdin.test_stdin_single_field", + "eval.tests.test_cli_io.TestStdinOptions.test_stdin_all_fields", + "eval.tests.test_cli_io.TestStdinOptions.test_stdin_with_length", + "eval.tests.test_cli_io.TestStdinOptions.test_stdin_with_offset", + "eval.tests.test_cli_io.TestStdinOptions.test_stdin_with_offset_and_length", + "eval.tests.test_data_view.TestDataViewDotEscape.test_nonprintable_bytes_escape_to_dots[three_ff_bytes]", + "eval.tests.test_data_view.TestDataViewDotEscape.test_nonprintable_bytes_escape_to_dots[three_high_continuation]", + "eval.tests.test_data_view.TestDataViewDotEscape.test_nonprintable_bytes_escape_to_dots[two_continuation_bytes]", + "eval.tests.test_data_view.TestNestedMessage.test_nested_message_with_string", + "eval.tests.test_data_view.TestNestedMessage.test_two_level_nesting", + "eval.tests.test_data_view.TestNestedMessage.test_valid_nested_message", + "eval.tests.test_data_view.TestNestedPayloadFailureFallback.test_aligned_four_high_bytes_read_as_float", + "eval.tests.test_data_view.TestNestedPayloadFailureFallback.test_deep_nested_five_byte_field_number", + "eval.tests.test_data_view.TestNestedPayloadFailureFallback.test_invalid_inner_tag_falls_back_to_packed_varints", + "eval.tests.test_data_view.TestNestedPayloadFailureFallback.test_single_zero_byte_is_packed_varint_zero", + "eval.tests.test_data_view.TestNonPrintableFallback.test_control_char_bytes_fallback_to_packed_varint", + "eval.tests.test_data_view.TestNonPrintableFallback.test_dot_escaped_fallback_string", + "eval.tests.test_data_view.TestNonPrintableFallback.test_high_bytes_packed_varint", + "eval.tests.test_data_view.TestNonPrintableFallback.test_mixed_printable_and_control_escaped", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_four_byte_payload_uses_float_probe", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_double", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_double_three_values", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_float_single", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_float_three_values", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_varint", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_varint_large_values", + "eval.tests.test_data_view.TestPackedRepeatedValues.test_packed_varint_two_bytes", + "eval.tests.test_data_view.TestPrintableString.test_empty_payload_is_rendered_as_empty_nested", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[alnum]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[hello]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[mixed_tokens]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[single_char]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[snake]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[symbols]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[two_alpha]", + "eval.tests.test_data_view.TestPrintableString.test_short_printable_string[word]", + "eval.tests.test_data_view.TestPrintableString.test_string_just_over_60_boundary", + "eval.tests.test_data_view.TestPrintableString.test_string_longer_than_60_truncated", + "eval.tests.test_data_view.TestPrintableString.test_string_spanning_exactly_60_chars", + "eval.tests.test_errors.TestCLIErrors.test_invalid_short_option", + "eval.tests.test_errors.TestCLIErrors.test_no_arguments_usage_error", + "eval.tests.test_errors.TestCLIErrors.test_offset_larger_than_file", + "eval.tests.test_errors.TestCLIErrors.test_too_many_arguments_usage_error", + "eval.tests.test_errors.TestEmptyInputs.test_empty_file_success_no_output", + "eval.tests.test_errors.TestEmptyInputs.test_length_zero_success_no_output", + "eval.tests.test_errors.TestEmptyInputs.test_missing_file_yields_empty_decode_success", + "eval.tests.test_errors.TestEmptyInputs.test_offset_to_exact_end_ok", + "eval.tests.test_errors.TestEndOfBuffer.test_truncated_varint[continuation_high_bits]", + "eval.tests.test_errors.TestEndOfBuffer.test_truncated_varint[field_then_truncated_value]", + "eval.tests.test_errors.TestEndOfBuffer.test_truncated_varint[multi_truncated_value]", + "eval.tests.test_errors.TestEndOfBuffer.test_truncated_varint[single_continuation_byte]", + "eval.tests.test_errors.TestEndOfBuffer.test_truncated_varint[two_continuation_then_end]", + "eval.tests.test_errors.TestInvalidTags.test_reserved_or_zero_tag_rejected[reserved_19000]", + "eval.tests.test_errors.TestInvalidTags.test_reserved_or_zero_tag_rejected[reserved_19001]", + "eval.tests.test_errors.TestInvalidTags.test_reserved_or_zero_tag_rejected[reserved_19999]", + "eval.tests.test_errors.TestInvalidTags.test_reserved_or_zero_tag_rejected[tag_zero]", + "eval.tests.test_errors.TestInvalidTags.test_tag_18999_valid_boundary", + "eval.tests.test_errors.TestInvalidTags.test_tag_20000_valid_boundary", + "eval.tests.test_errors.TestVarintTooLong.test_varint_ten_byte_boundary_ok", + "eval.tests.test_errors.TestVarintTooLong.test_varint_too_long[eleven_all_continuation]", + "eval.tests.test_errors.TestVarintTooLong.test_varint_too_long[eleven_continuation_bytes]", + "eval.tests.test_errors.TestVarintTooLong.test_varint_too_long[twenty_all_continuation]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_negative_zero_is_negative_zero", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[denormal]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[huge]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[inf]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[nan]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[neg_inf]", + "eval.tests.test_float_special_values.TestDoubleSpecialValues.test_double_value_stdout[negative]", + "eval.tests.test_float_special_values.TestFixedPointFieldVariants.test_negative_and_fractional_doubles_multiple_fields", + "eval.tests.test_float_special_values.TestFloatSpecialValues.test_float_max_value", + "eval.tests.test_float_special_values.TestFloatSpecialValues.test_float_value_stdout[inf]", + "eval.tests.test_float_special_values.TestFloatSpecialValues.test_float_value_stdout[nan]", + "eval.tests.test_float_special_values.TestFloatSpecialValues.test_float_value_stdout[neg_inf]", + "eval.tests.test_float_special_values.TestFloatSpecialValues.test_float_value_stdout[negative]", + "eval.tests.test_varint_decode.TestMultiByteFieldNumberTags.test_multi_byte_field_number_round_trip[five_byte_tag]", + "eval.tests.test_varint_decode.TestMultiByteFieldNumberTags.test_multi_byte_field_number_round_trip[four_byte_tag]", + "eval.tests.test_varint_decode.TestMultiByteVarintField.test_many_varint_fields_in_one_message", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[field_1000]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[field_127]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[field_128]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[field_200]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[fifteen]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[max_legitimate_field]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[max_two_byte_field]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[min_field]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[min_three_byte_field]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[sixteen]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_field_number_round_trip[small]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_tag_zero_rejected[zero_tag]", + "eval.tests.test_varint_decode.TestVarintFieldNumberBoundaries.test_tag_zero_rejected[zero_tag_two_bytes]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_bool_style_varint[bool_false]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_bool_style_varint[bool_true]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[int32_max]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[int32_max_plus_one]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[max_four_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[max_one_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[max_three_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[max_two_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[min_five_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[min_four_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[min_three_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[min_two_byte]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[one]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_positive_varint[zero]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[18446744073709551606-unsigned_neg10]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[18446744073709551614-unsigned_neg2]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[18446744073709551615-unsigned_max_is_minus_one]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[9223372036854775807-int64_max]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[9223372036854775808-int64_max_plus_one_becomes_min]", + "eval.tests.test_varint_decode.TestVarintFieldValues.test_signed_int64_reinterpretation[9223372036854775809-neg_9223372036854775807]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_six_byte_varint_mid_range", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[eight_byte_max]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[five_byte_max]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[min_six_byte]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[nine_byte_max]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[seven_byte_max]", + "eval.tests.test_varint_decode.TestVarintWidthUpperBoundaries.test_varint_width_upper_boundary[six_byte_max]", + "eval.tests.test_wire_types.TestFixed32WireType.test_fixed32_round_trip_via_raw_bits", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[hundred]", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[minus_one]", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[one]", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[one_point_five]", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[three]", + "eval.tests.test_wire_types.TestFixed32WireType.test_float_field[zero]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[hundred]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[minus_one]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[one]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[one_point_five]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[two_point_five]", + "eval.tests.test_wire_types.TestFixed64WireType.test_double_field[zero]", + "eval.tests.test_wire_types.TestFixed64WireType.test_fixed64_field_number_higher", + "eval.tests.test_wire_types.TestFixed64WireType.test_fixed64_reinterpreted_as_large_double", + "eval.tests.test_wire_types.TestTagAndWireTypeBoundary.test_all_supported_wire_types_one_message", + "eval.tests.test_wire_types.TestTagAndWireTypeBoundary.test_wire_type_bits_from_multi_byte_tag", + "eval.tests.test_wire_types.TestWireTypeDispatch.test_mixed_wire_types_in_message", + "eval.tests.test_wire_types.TestWireTypeDispatch.test_unknown_wire_type_rejected[wire3]", + "eval.tests.test_wire_types.TestWireTypeDispatch.test_unknown_wire_type_rejected[wire4]", + "eval.tests.test_wire_types.TestWireTypeDispatch.test_unknown_wire_type_rejected[wire6]", + "eval.tests.test_wire_types.TestWireTypeDispatch.test_unknown_wire_type_rejected[wire7]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.TestArgumentErrors.test_missing_required_argument_for_length", + "eval.tests.test_cli.TestArgumentErrors.test_missing_required_argument_for_offset", + "eval.tests.test_cli.TestArgumentErrors.test_nonexistent_input_file_treated_as_empty", + "eval.tests.test_cli.TestArgumentErrors.test_too_many_positional_args_fails", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_fails_nonzero[--bogus]", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_fails_nonzero[-?]", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_fails_nonzero[-x]", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_fails_nonzero[-z]", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_name_reported[--bogus-unrecognized option '--bogus']", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_name_reported[--definitely-not-an-option-unrecognized option '--definitely-not-an-option']", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_name_reported[-?-invalid option -- '?']", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_name_reported[-x-invalid option -- 'x']", + "eval.tests.test_cli.TestArgumentErrors.test_unknown_option_name_reported[-z-invalid option -- 'z']", + "eval.tests.test_cli.TestFringeInputHandling.test_directory_as_input_file_fails", + "eval.tests.test_cli.TestFringeInputHandling.test_negative_length_behaves_as_unlimited", + "eval.tests.test_cli.TestFringeInputHandling.test_negative_offset_wraps_to_huge", + "eval.tests.test_cli.TestFringeInputHandling.test_option_after_positional_is_permuted", + "eval.tests.test_cli.TestHelpAndUsage.test_help_exits_zero_with_usage[--help]", + "eval.tests.test_cli.TestHelpAndUsage.test_help_exits_zero_with_usage[-h]", + "eval.tests.test_cli.TestHelpAndUsage.test_help_long_form_and_short_form_identical[--help]", + "eval.tests.test_cli.TestHelpAndUsage.test_help_long_form_and_short_form_identical[-h]", + "eval.tests.test_cli.TestHelpAndUsage.test_help_to_stdout_not_stderr", + "eval.tests.test_cli.TestHelpAndUsage.test_no_args_prints_usage_to_stderr_and_exits_nonzero", + "eval.tests.test_cli.TestHelpAndUsage.test_single_help_entry_among_empty_files", + "eval.tests.test_cli.TestOptionPrecedence.test_help_ignores_trailing_input_filename", + "eval.tests.test_cli.TestOptionPrecedence.test_help_short_circuits_options_and_input[argv0]", + "eval.tests.test_cli.TestOptionPrecedence.test_help_short_circuits_options_and_input[argv1]", + "eval.tests.test_cli.TestOptionPrecedence.test_help_short_circuits_options_and_input[argv2]", + "eval.tests.test_cli.TestOptionPrecedence.test_long_form_equals_length_cuts_field", + "eval.tests.test_cli.TestOptionPrecedence.test_long_form_equals_offset_and_length", + "eval.tests.test_cli.TestOptionPrecedence.test_offset_then_length_recarves_buffer", + "eval.tests.test_cli.TestOptionPrecedence.test_repeated_length_option_last_value_wins", + "eval.tests.test_cli.TestOptionPrecedence.test_repeated_offset_option_last_value_wins", + "eval.tests.test_cli.TestStdinMode.test_stdin_empty_stream_is_ok", + "eval.tests.test_cli.TestStdinMode.test_stdin_multiple_fields_preserved_order", + "eval.tests.test_cli.TestStdinMode.test_stdin_reads_field", + "eval.tests.test_dotted_string_fallback.TestDottedStringFileMode.test_dotted_output_matches_between_file_and_stdin", + "eval.tests.test_dotted_string_fallback.TestDottedStringFileMode.test_fixed_file_input_with_control_bytes", + "eval.tests.test_dotted_string_fallback.TestDottedStringRendering.test_control_and_high_bytes_mix_as_dots", + "eval.tests.test_dotted_string_fallback.TestDottedStringRendering.test_dangling_control_bytes_render_dots[\\n\\x01\\x80-1: \".\"\\n]", + "eval.tests.test_dotted_string_fallback.TestDottedStringRendering.test_dangling_control_bytes_render_dots[\\n\\x01\\xff-1: \".\"\\n]", + "eval.tests.test_dotted_string_fallback.TestDottedStringRendering.test_dangling_control_bytes_render_dots[\\n\\x02\\x80\\x81-1: \"..\"\\n]", + "eval.tests.test_dotted_string_fallback.TestDottedStringRendering.test_dangling_control_bytes_render_dots[\\n\\x03\\x80\\x81\\x82-1: \"...\"\\n]", + "eval.tests.test_dotted_string_fallback.TestDottedStringTruncation.test_exactly_60_control_bytes_take_float_path", + "eval.tests.test_dotted_string_fallback.TestDottedStringTruncation.test_over_60_dotted_truncates_to_60_without_ellipsis", + "eval.tests.test_dotted_string_fallback.TestPackedVarintLeakyPrefix.test_leaky_multi_value_then_dotted", + "eval.tests.test_dotted_string_fallback.TestPackedVarintLeakyPrefix.test_leaky_newline_prefix_then_dotted", + "eval.tests.test_dotted_string_fallback.TestPackedVarintLeakyPrefix.test_leaky_single_value_then_dotted", + "eval.tests.test_exception_routes.TestDottedFallbackIsprintRendering.test_apostrophe_bytes_decode_as_packed_varint", + "eval.tests.test_exception_routes.TestDottedFallbackIsprintRendering.test_apostrophe_plus_truncated_continuation_leaks_then_dotted", + "eval.tests.test_exception_routes.TestDottedFallbackIsprintRendering.test_apostrophe_plus_two_overlong_bytes_leaks_then_dotted", + "eval.tests.test_exception_routes.TestMultibytePackedVarintBoundaries.test_multibyte_bytes_forming_message_win_over_packed", + "eval.tests.test_exception_routes.TestMultibytePackedVarintBoundaries.test_two_and_three_byte_packed_varints", + "eval.tests.test_exception_routes.TestNestedInvalidWireTypeTolerated.test_nested_message_aborted_at_invalid_wire_discards_partial_output", + "eval.tests.test_exception_routes.TestNestedInvalidWireTypeTolerated.test_same_invalid_wire_bytes_in_length_field_are_tolerated", + "eval.tests.test_exception_routes.TestNestedInvalidWireTypeTolerated.test_top_level_invalid_wire_type_aborts_decode", + "eval.tests.test_exception_routes.TestPackedDoubleLongList.test_five_value_packed_double", + "eval.tests.test_exception_routes.TestRichNestedAndMixedStructure.test_interleaved_top_level_wire_types", + "eval.tests.test_exception_routes.TestRichNestedAndMixedStructure.test_nested_varint_string_double_float_indentation", + "eval.tests.test_exception_routes.TestRichNestedAndMixedStructure.test_two_level_message_with_value_exact", + "eval.tests.test_exception_routes.TestVarintTooLongInPackedField.test_clean_value_then_overlong_packed_varint_leaks_prefix", + "eval.tests.test_exception_routes.TestVarintTooLongInPackedField.test_eleven_byte_overlong_packed_varint_falls_to_dotted", + "eval.tests.test_exception_routes.TestVarintTooLongInPackedField.test_ten_byte_max_valid_packed_varint_decodes", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_reading_fixed32_past_end", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_reading_fixed64_past_end", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_truncated_length_delimited[data_len_payload0]", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_truncated_length_delimited[data_len_payload1]", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_truncated_length_delimited[data_len_payload2]", + "eval.tests.test_exceptions.TestEndOfBufferVariants.test_truncated_offset_read_raises_end_of_buffer", + "eval.tests.test_exceptions.TestExceptionDispatch.test_all_errors_set_nonzero_and_empty_stdout", + "eval.tests.test_exceptions.TestExceptionDispatch.test_messages_differ_per_error", + "eval.tests.test_exceptions.TestExceptionMessages.test_end_of_buffer_message", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_from_truncated_header[152000]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_from_truncated_header[152040]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_from_truncated_header[159992]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_from_truncated_header[4294967296]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_from_truncated_header[8589934592]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_reserved_range[19000]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_reserved_range[19001]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_reserved_range[19800]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_reserved_range[19999]", + "eval.tests.test_exceptions.TestExceptionMessages.test_invalid_tag_zero_message", + "eval.tests.test_exceptions.TestExceptionMessages.test_unknown_wire_type_message", + "eval.tests.test_exceptions.TestExceptionMessages.test_varint_too_long_message", + "eval.tests.test_filemode.TestFileMissingErrors.test_missing_file_decodes_as_empty", + "eval.tests.test_filemode.TestFileRead.test_binary_file_bytes_preserved", + "eval.tests.test_filemode.TestFileRead.test_empty_file_decodes_to_nothing", + "eval.tests.test_filemode.TestFileRead.test_file_with_double_field", + "eval.tests.test_filemode.TestFileRead.test_file_with_multiple_fields", + "eval.tests.test_filemode.TestFileRead.test_file_with_single_varint_field", + "eval.tests.test_filemode.TestFileRead.test_file_with_string_field", + "eval.tests.test_filemode.TestFileRead.test_offset_and_length_on_file", + "eval.tests.test_filemode.TestFileVsStdinConsistency.test_file_and_stdin_equal[\\n\\x05hello]", + "eval.tests.test_filemode.TestFileVsStdinConsistency.test_file_and_stdin_equal[\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x04@]", + "eval.tests.test_filemode.TestFileVsStdinConsistency.test_file_and_stdin_equal[\\x08\\x07]", + "eval.tests.test_fixed.TestDoubleValues.test_double_max_finite", + "eval.tests.test_fixed.TestDoubleValues.test_double_min_normal_positive", + "eval.tests.test_fixed.TestDoubleValues.test_double_nan_is_not_numeric", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[-0.0]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[-1.0]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[-1.5e-300]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[0.0]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[0.5]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[1.0]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[1.5e+300]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[100.25]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[12345.6789]", + "eval.tests.test_fixed.TestDoubleValues.test_double_round_trip[2.5]", + "eval.tests.test_fixed.TestDoubleValues.test_double_special_raw[0-0]", + "eval.tests.test_fixed.TestDoubleValues.test_double_special_raw[18442240474082181120--inf]", + "eval.tests.test_fixed.TestDoubleValues.test_double_special_raw[9218868437227405312-inf]", + "eval.tests.test_fixed.TestDoubleValues.test_double_special_raw[9223372036854775808--0]", + "eval.tests.test_fixed.TestFixedRawInterpretation.test_double_roundtrip_matches_zero_double_bytes", + "eval.tests.test_fixed.TestFixedRawInterpretation.test_float_raw_bytes_roundtrip", + "eval.tests.test_fixed.TestFloatValues.test_float_max_float", + "eval.tests.test_fixed.TestFloatValues.test_float_min_normal_positive", + "eval.tests.test_fixed.TestFloatValues.test_float_nan", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[-0.0]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[-1.0]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[-100.25]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[0.0]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[0.5]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[1.0]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[1.5e-10]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[123.456]", + "eval.tests.test_fixed.TestFloatValues.test_float_round_trip[2.5]", + "eval.tests.test_fixed.TestFloatValues.test_float_special_raw[0-0]", + "eval.tests.test_fixed.TestFloatValues.test_float_special_raw[2139095040-inf]", + "eval.tests.test_fixed.TestFloatValues.test_float_special_raw[2147483648--0]", + "eval.tests.test_fixed.TestFloatValues.test_float_special_raw[4286578688--inf]", + "eval.tests.test_mixed_decode.TestAllWireTypesInOneMessage.test_fixed64_varint_fixed32_string", + "eval.tests.test_mixed_decode.TestAllWireTypesInOneMessage.test_high_tag_first_still_prints_first", + "eval.tests.test_mixed_decode.TestAllWireTypesInOneMessage.test_packed_varint_then_adjacent_string", + "eval.tests.test_mixed_decode.TestAllWireTypesInOneMessage.test_wire_types_reflect_input_order", + "eval.tests.test_mixed_decode.TestDeepNestedMixedMessage.test_two_level_nest_with_scalars", + "eval.tests.test_mixed_decode.TestValueFormattingAcrossConcatenatedFields.test_double_list_negative_and_fractional", + "eval.tests.test_mixed_decode.TestValueFormattingAcrossConcatenatedFields.test_packed_float_negative_values", + "eval.tests.test_offset_length.TestLength.test_length_cut_mid_field_raises_end_of_buffer", + "eval.tests.test_offset_length.TestLength.test_length_exact_file_size", + "eval.tests.test_offset_length.TestLength.test_length_larger_than_file_reads_all", + "eval.tests.test_offset_length.TestLength.test_length_partial_reads_first_field_only", + "eval.tests.test_offset_length.TestLength.test_length_zero_decodes_nothing", + "eval.tests.test_offset_length.TestOffset.test_offset_beyond_file_fails", + "eval.tests.test_offset_length.TestOffset.test_offset_equal_size_gives_empty", + "eval.tests.test_offset_length.TestOffset.test_offset_into_value_changes_decoded_field", + "eval.tests.test_offset_length.TestOffset.test_offset_zero_is_noop", + "eval.tests.test_offset_length.TestOffsetAndLengthCombined.test_offset_and_length_cover_second_field", + "eval.tests.test_offset_length.TestOffsetAndLengthCombined.test_offset_skips_first_field", + "eval.tests.test_offset_length.TestOffsetAndLengthCombined.test_offset_then_limited_length_truncates_field", + "eval.tests.test_offset_length.TestOptionSyntax.test_short_and_long_length_equivalent", + "eval.tests.test_offset_length.TestOptionSyntax.test_short_and_long_offset_equivalent", + "eval.tests.test_packed_formatting_specials.TestDeepEmptyNesting.test_four_level_empty_nest", + "eval.tests.test_packed_formatting_specials.TestDeepEmptyNesting.test_three_level_empty_nest", + "eval.tests.test_packed_formatting_specials.TestPackedDoubleSpecialValues.test_packed_double_huge_and_tiny", + "eval.tests.test_packed_formatting_specials.TestPackedDoubleSpecialValues.test_packed_double_inf_and_nan", + "eval.tests.test_packed_formatting_specials.TestPackedDoubleSpecialValues.test_packed_double_negative_and_positive_zeros", + "eval.tests.test_packed_formatting_specials.TestPackedVarintInt64Boundaries.test_packed_varint_large_boundaries[18446744073709551615--1]", + "eval.tests.test_packed_formatting_specials.TestPackedVarintInt64Boundaries.test_packed_varint_large_boundaries[9223372036854775807-9223372036854775807]", + "eval.tests.test_packed_formatting_specials.TestPackedVarintInt64Boundaries.test_packed_varint_large_boundaries[9223372036854775808--9223372036854775808]", + "eval.tests.test_packed_formatting_specials.TestPackedVarintInt64Boundaries.test_packed_varint_mixed_sizes", + "eval.tests.test_strings_packed.TestDecodeOrderHeuristic.test_single_pad_boundary_between_message_and_string", + "eval.tests.test_strings_packed.TestDecodeOrderHeuristic.test_two_char_payload_decoded_as_nested_message", + "eval.tests.test_strings_packed.TestGenericStringDottedOutput.test_lowercase_letters_not_printable_set_fall_to_packed", + "eval.tests.test_strings_packed.TestGenericStringDottedOutput.test_single_byte_high_val_not_printable", + "eval.tests.test_strings_packed.TestLengthDelimitedErrors.test_oversized_declared_length", + "eval.tests.test_strings_packed.TestLengthDelimitedErrors.test_truncated_packed_payload", + "eval.tests.test_strings_packed.TestNestedMessage.test_empty_payload_is_empty_message", + "eval.tests.test_strings_packed.TestNestedMessage.test_nested_message_prints_both_levels", + "eval.tests.test_strings_packed.TestNestedMessage.test_single_nested_varint_field", + "eval.tests.test_strings_packed.TestNestedMessage.test_two_level_nested", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_double_empty_payload", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_double_single", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_double_values", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_float_empty_payload", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_float_multiple_values", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_float_single_reaches_float_iterator", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_float_values", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_length_not_multiple_of_8_falls_to_varint", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_varint_mixed_small", + "eval.tests.test_strings_packed.TestPackedRepeated.test_packed_varint_order", + "eval.tests.test_strings_packed.TestPrintableString.test_printable_string_with_all_allowed_chars", + "eval.tests.test_strings_packed.TestPrintableString.test_short_printable_string", + "eval.tests.test_strings_packed.TestPrintableString.test_string_exactly_max_length_not_truncated", + "eval.tests.test_strings_packed.TestPrintableString.test_string_just_above_max_truncated", + "eval.tests.test_strings_packed.TestPrintableString.test_string_just_below_max_not_truncated", + "eval.tests.test_strings_packed.TestPrintableString.test_string_max_length_truncated_with_ellipsis", + "eval.tests.test_strings_packed.TestPrintableString.test_string_pad_exactly_at_non_truncating_boundary", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[0]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19000]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19001]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19005]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19800]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19998]", + "eval.tests.test_tags.TestInvalidTags.test_reserved_or_zero_tag_rejected[19999]", + "eval.tests.test_tags.TestMixedValidFields.test_mixed_success_then_invalid_fails_whole", + "eval.tests.test_tags.TestReservedRangeBoundaries.test_18999_valid_just_below_range", + "eval.tests.test_tags.TestReservedRangeBoundaries.test_19999_invalid_at_range_end", + "eval.tests.test_tags.TestReservedRangeBoundaries.test_20000_valid_just_above_range", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_large_tag_uses_multi_byte_header", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_stdout_tag_matches_header[100]", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_stdout_tag_matches_header[17]", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_stdout_tag_matches_header[1]", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_stdout_tag_matches_header[2047]", + "eval.tests.test_tags.TestTagAsDecodedHeaderValue.test_stdout_tag_matches_header[2048]", + "eval.tests.test_tags.TestTruncatedHeaderBoundary.test_header_at_2p32_wraps_to_tag_zero", + "eval.tests.test_tags.TestTruncatedHeaderBoundary.test_header_at_2p33_wraps_to_tag_zero", + "eval.tests.test_tags.TestTruncatedHeaderBoundary.test_header_wrapping_into_reserved_range", + "eval.tests.test_tags.TestTruncatedHeaderBoundary.test_header_wrapping_to_valid_small_tag", + "eval.tests.test_tags.TestValidTags.test_max_tag_2p29_minus_one_valid", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[127]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[128]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[15]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[16]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[18999]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[1]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[20000]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[20001]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[2]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_decodes_value[536870911]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[100]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[15]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[18999]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[1]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[20000]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[7]", + "eval.tests.test_tags.TestValidTags.test_valid_tag_exhaustive_small[9]", + "eval.tests.test_varint.TestMultipleVarintFields.test_ordered_multi_value", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[0]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[127]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[128]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[16383]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[16384]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[2097151]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[2097152]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[268435455]", + "eval.tests.test_varint.TestVarintHeaderSizes.test_multi_byte_payloads[268435456]", + "eval.tests.test_varint.TestVarintParsingErrors.test_eleven_byte_varint", + "eval.tests.test_varint.TestVarintParsingErrors.test_lonely_continuation_byte_at_end_of_input", + "eval.tests.test_varint.TestVarintParsingErrors.test_ten_byte_varint_limit_succeeds", + "eval.tests.test_varint.TestVarintValues.test_int64_max", + "eval.tests.test_varint.TestVarintValues.test_int64_min", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[0-0]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[1-1]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[127-127]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[128-128]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[16384-16384]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[2097152-2097152]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[255-255]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[256-256]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[268435456-268435456]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[300-300]", + "eval.tests.test_varint.TestVarintValues.test_positive_varint[9223372036854775807-9223372036854775807]", + "eval.tests.test_varint.TestVarintValues.test_signed_negative_interpretation[-1--1]", + "eval.tests.test_varint.TestVarintValues.test_signed_negative_interpretation[-1152921504606846976--1152921504606846976]", + "eval.tests.test_varint.TestVarintValues.test_signed_negative_interpretation[-2--2]", + "eval.tests.test_varint.TestVarintValues.test_signed_negative_interpretation[-9223372036854775807--9223372036854775807]", + "eval.tests.test_varint.TestVarintValues.test_signed_negative_interpretation[-9223372036854775808--9223372036854775808]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_after_valid_field[3]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_after_valid_field[4]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_after_valid_field[6]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_after_valid_field[7]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_at_tag_boundary[3]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_at_tag_boundary[4]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_at_tag_boundary[6]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_at_tag_boundary[7]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_rejected[3]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_rejected[4]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_rejected[6]", + "eval.tests.test_wire_types.TestUnknownWireTypes.test_unknown_wire_type_rejected[7]" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bool/data-also-true.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bool/data-false.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bool/data-still-true.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bool/data-true.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bytes/data-binary.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bytes/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bytes/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/bytes/data-string.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/complex/data-all.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/complex/data-minimal.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/complex/data-some.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/double/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/double/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/double/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/enum/data-black.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/enum/data-blue.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/enum/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/enum/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/enum/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed32/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed32/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed32/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed32/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed64/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed64/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed64/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/fixed64/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/float/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/float/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/float/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int32/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/int64/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/message/data-message.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/message/data-opt-element.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/message/data-opt-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/nested/data-message.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/nested/data-no-message.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_bool/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_bool/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_bool/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_double/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_double/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_double/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_enum/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_enum/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_enum/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed32/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed32/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed32/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed64/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed64/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_fixed64/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_float/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_float/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_float/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int32/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int32/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int32/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int64/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int64/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_int64/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed32/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed32/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed32/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed64/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed64/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sfixed64/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint32/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint32/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint32/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint64/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint64/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_sint64/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint32/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint32/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint32/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint64/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint64/data-many.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/repeated_packed_uint64/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed32/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sfixed64/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint32/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-min.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-neg.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-neg200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/sint64/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/string/data-empty.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/string/data-one.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/string/data-string.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tag_and_type/data-combined.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tag_and_type/data-not-packed.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tag_and_type/data-packed.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tags/data-tag-1.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tags/data-tag-200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tags/data-tag-200000.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/tags/data-tag-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint32/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint32/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint32/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint32/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint64/data-max.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint64/data-pos.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint64/data-pos200.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/uint64/data-zero.pbf]", + "eval.tests.test_pbf_decoder.test_decode_pbf_matches_upstream_golden[test/t/vector_tile/data.vector.pbf]", + "eval.tests.test_pbf_decoder.test_help_flag_prints_usage_text", + "eval.tests.test_pbf_decoder.test_help_short_flag_prints_usage_text", + "eval.tests.test_pbf_decoder.test_missing_input_argument_errors", + "eval.tests.test_pbf_decoder.test_offset_and_length_select_subrange", + "eval.tests.test_pbf_decoder.test_offset_larger_than_file_errors", + "eval.tests.test_pbf_decoder.test_read_from_stdin_matches_file_input", + "eval.tests.test_pbf_decoder.test_truncated_length_reports_end_of_buffer" + ] + } + }, + "commit": "203aa1536e5637d5f09df113a5ddc9559e17f375", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9787281771384917, + "eval_clean_hashes": [ + "13f9706c4df52a8c893a15745506a6d1b149d126fa26f227e756a0253463b9fb" + ], + "input_record": { + "commit": "203aa1536e5637d5f09df113a5ddc9559e17f375", + "difficulty": "easy", + "difficulty_code_lines": 4761, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 4761, + "difficulty_runtime_deps": 1, + "difficulty_score": 1.9787281771384917, + "difficulty_test_code_lines": 24051, + "full_name": "mapbox/protozero", + "input_joern_zip": "cpp_joern/mapbox__protozero.zip", + "joern_status": true, + "joern_time": 9.416872725822031, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "ip7z/7zip", + "rank": 350, + "similarity": 0.4120529890060425 + } + ], + "repo_path": "cpp/mapbox__protozero", + "source": "commit:203aa1536e5637d5f09df113a5ddc9559e17f375", + "status": "done", + "url": "https://github.com/mapbox/protozero" + }, + "instance_id": "mapbox__protozero.203aa15", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 3, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 5, + "module_kind": "tests", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "mapbox/protozero" +} diff --git a/mapbox--protozero.203aa15/tests/test.sh b/mapbox--protozero.203aa15/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mapbox--protozero.203aa15/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mapbox--protozero.203aa15/tests/workspace.tar.gz b/mapbox--protozero.203aa15/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e42a0133b1232a5df2482d713a009243c95106db --- /dev/null +++ b/mapbox--protozero.203aa15/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a99a98a2356a69416dfe64ba2cd2579c655a3ef73f61db42a978108b88eed06 +size 2562 diff --git a/marbl--mashmap.1a07d0e/environment/Dockerfile b/marbl--mashmap.1a07d0e/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/marbl--mashmap.1a07d0e/environment/docker-compose.yaml b/marbl--mashmap.1a07d0e/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/marbl--mashmap.1a07d0e/environment/download.sh b/marbl--mashmap.1a07d0e/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..442c185b886fec7a860b8d49317608306edfa730 --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/download.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# download.sh (ProgramGym download stage) +# +# Standalone, source-safe dependency prefetch for building MashMap. +# This script is executed via `source /source_ro/download.sh` inside a +# networked container. It ONLY prepares dependencies/caches and exports the +# environment variables consumed by build.sh. It never compiles, links, tests, +# configures, or builds the project. +# +# Requirements for the mashmap executable (see CMakeLists.txt +# target_link_libraries: gsl gslcblas m pthread z): +# - libgsl-dev -> provides libgsl / libgslcblas (GNU Scientific Library) +# - zlib1g-dev -> provides libz +# - libm, pthread are provided by gcc/build-essential already in the image. +# CMake >= 3.21, gcc/g++ 13, make, git are already present in the base image. + +# Refresh the apt index and install the C/C++ dev dependencies MashMap links +# against. This is dependency setup only; no compilation or build step here. +apt-get update +apt-get install -y --no-install-recommends \ + libgsl-dev \ + zlib1g-dev + +# Export build configuration consumed by build.sh. CMAKE_BUILD_TYPE=Release is +# the documented default (see INSTALL.txt), enabling optimizations. +export CMAKE_BUILD_TYPE=Release diff --git a/marbl--mashmap.1a07d0e/environment/executable b/marbl--mashmap.1a07d0e/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..764d6da0edf1378a6b9db7b99b6204e03fe40683 --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2c37ff087ddb2ab4e9cd2115dca694b48edefdc08a36568ebb6ffadd147a22c +size 490704 diff --git a/marbl--mashmap.1a07d0e/environment/harbor_configure_apt_mirror.sh b/marbl--mashmap.1a07d0e/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/marbl--mashmap.1a07d0e/environment/harbor_prepare_download_env.sh b/marbl--mashmap.1a07d0e/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marbl--mashmap.1a07d0e/environment/workspace.tar.gz b/marbl--mashmap.1a07d0e/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6726ec27d13a340ece69de952ce3266355a2d063 --- /dev/null +++ b/marbl--mashmap.1a07d0e/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cea623b097b3930b337ad7a7af23a1bba97816c0f0312feea888b8898ada487 +size 17301 diff --git a/marbl--mashmap.1a07d0e/instruction.md b/marbl--mashmap.1a07d0e/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/marbl--mashmap.1a07d0e/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/marbl--mashmap.1a07d0e/solution/solve.sh b/marbl--mashmap.1a07d0e/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/marbl--mashmap.1a07d0e/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/marbl--mashmap.1a07d0e/task.toml b/marbl--mashmap.1a07d0e/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e984e22ff52935b0eee2fb0a22019f15ec2ce47e --- /dev/null +++ b/marbl--mashmap.1a07d0e/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/marbl--mashmap.1a07d0e" +description = "Synthetic ProgramGym cleanroom reconstruction task for marbl/MashMap" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "marbl__MashMap.1a07d0e" +repository = "marbl/MashMap" +commit = "1a07d0ea4e2c7c4a97fc92cbc29abc05e8cba7eb" +language = "cpp" +difficulty = "medium" +difficulty_score = 2.870029150013057 +test_branches = 5 +test_count = 703 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/marbl--mashmap.1a07d0e/tests/Dockerfile b/marbl--mashmap.1a07d0e/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_02.tar.gz b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..11d60db1156384bc5c25405a96f89b0801abe9af --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03144fbc0baad92bf3acf9460abda22d7220d31b8f56dcca503d7a32d42af92c +size 26441 diff --git a/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_03.tar.gz b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..660a0f40cf32f8f0086b6ef28facb076442eb787 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abc1e62bf93c99b30dffcdecdbe65f28704456098f09aab34547f3164e0bbb57 +size 50419 diff --git a/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_04.tar.gz b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..eac03ee16d3096f90a2752c6f7ebfa96bd197829 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbcb52946d4357443df41e7ba022fad47576dde9015741af7aa30a74f75fd251 +size 147786 diff --git a/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_05.tar.gz b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_05.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..08c1c140ae837e6d0a8669737a5b5900058b2093 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_05.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67e8bb396b0815251ccf7da7efe20dd2ef964fea35323c62d8fe24f85b893cd6 +size 32146 diff --git a/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_06.tar.gz b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_06.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..305655085b914732e567d86d30cbf10d41b89130 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/blobs/tests/generated_module_06.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b3857567e4b5b2b3e220f5c821f4ece4bfd17a4be548f407dbbf0f4ec399086 +size 64647 diff --git a/marbl--mashmap.1a07d0e/tests/docker-compose.yaml b/marbl--mashmap.1a07d0e/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/marbl--mashmap.1a07d0e/tests/download.sh b/marbl--mashmap.1a07d0e/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..442c185b886fec7a860b8d49317608306edfa730 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/download.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# download.sh (ProgramGym download stage) +# +# Standalone, source-safe dependency prefetch for building MashMap. +# This script is executed via `source /source_ro/download.sh` inside a +# networked container. It ONLY prepares dependencies/caches and exports the +# environment variables consumed by build.sh. It never compiles, links, tests, +# configures, or builds the project. +# +# Requirements for the mashmap executable (see CMakeLists.txt +# target_link_libraries: gsl gslcblas m pthread z): +# - libgsl-dev -> provides libgsl / libgslcblas (GNU Scientific Library) +# - zlib1g-dev -> provides libz +# - libm, pthread are provided by gcc/build-essential already in the image. +# CMake >= 3.21, gcc/g++ 13, make, git are already present in the base image. + +# Refresh the apt index and install the C/C++ dev dependencies MashMap links +# against. This is dependency setup only; no compilation or build step here. +apt-get update +apt-get install -y --no-install-recommends \ + libgsl-dev \ + zlib1g-dev + +# Export build configuration consumed by build.sh. CMAKE_BUILD_TYPE=Release is +# the documented default (see INSTALL.txt), enabling optimizations. +export CMAKE_BUILD_TYPE=Release diff --git a/marbl--mashmap.1a07d0e/tests/executable b/marbl--mashmap.1a07d0e/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..764d6da0edf1378a6b9db7b99b6204e03fe40683 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2c37ff087ddb2ab4e9cd2115dca694b48edefdc08a36568ebb6ffadd147a22c +size 490704 diff --git a/marbl--mashmap.1a07d0e/tests/harbor_configure_apt_mirror.sh b/marbl--mashmap.1a07d0e/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/marbl--mashmap.1a07d0e/tests/harbor_prepare_download_env.sh b/marbl--mashmap.1a07d0e/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marbl--mashmap.1a07d0e/tests/programgym_evaluator.py b/marbl--mashmap.1a07d0e/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/marbl--mashmap.1a07d0e/tests/programgym_task.json b/marbl--mashmap.1a07d0e/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..4aa3b60d91161a0d9c232ab2b52e1394659314fd --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/programgym_task.json @@ -0,0 +1,887 @@ +{ + "branches": { + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_validation_errors.test_missing_reference_file_validated_after_parse", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_validation_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_additional_options.test_all_vs_all_resets_skip_self_to_false", + "eval.tests.test_additional_options.test_all_vs_all_with_skip_self_enables", + "eval.tests.test_additional_options.test_drop_low_map_id_flag_accepted", + "eval.tests.test_additional_options.test_filter_length_mismatches_flag_accepted", + "eval.tests.test_additional_options.test_hg_filter_ani_diff_scaled_to_fraction", + "eval.tests.test_additional_options.test_hg_filter_conf_scaled_to_fraction", + "eval.tests.test_additional_options.test_hg_filter_defaults", + "eval.tests.test_additional_options.test_kmer_size_affects_output_content", + "eval.tests.test_additional_options.test_kmer_threshold_non_default_accepted", + "eval.tests.test_additional_options.test_lower_triangular_flag_accepted", + "eval.tests.test_additional_options.test_num_mappings_for_segment_two_is_accepted", + "eval.tests.test_additional_options.test_output_to_nested_path", + "eval.tests.test_additional_options.test_save_index_long_option_with_dash_equals", + "eval.tests.test_additional_options.test_segment_length_explicit_affects_split_output", + "eval.tests.test_additional_options.test_sparsify_zero_filters_all_mappings", + "eval.tests.test_index_tsv.test_load_index_tsv_reuses_saved_index", + "eval.tests.test_index_tsv.test_save_index_tsv_writes_typed_table", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_larger_for_strict_segment", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_varies_with_identity[85-130]", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_varies_with_identity[90-50]", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_varies_with_identity[95-20]", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_varies_with_kmer[15-70]", + "eval.tests.test_map_stats_sketch.test_auto_sketch_size_varies_with_kmer[19-130]", + "eval.tests.test_map_stats_sketch.test_explicit_sketch_size_bypasses_computation", + "eval.tests.test_map_stats_sketch.test_sketch_size_floor_is_ten", + "eval.tests.test_parameter_aliases.test_multichar_short_alias_pi_rejected", + "eval.tests.test_parameter_aliases.test_short_block_length_l_above_segment_echoed", + "eval.tests.test_parameter_aliases.test_short_chain_gap_c_echoed", + "eval.tests.test_parameter_aliases.test_short_drop_low_map_id_K_completes_mapping", + "eval.tests.test_parameter_aliases.test_short_no_merge_M_appends_jaccard_field", + "eval.tests.test_parameter_aliases.test_short_num_mappings_n_echoed", + "eval.tests.test_parameter_aliases.test_short_sketchsize_J_echoes_sketch", + "eval.tests.test_parameter_aliases.test_short_skip_prefix_Y_delimiter_banner", + "eval.tests.test_parameter_aliases.test_short_skip_self_X_flips_banner", + "eval.tests.test_parameter_aliases.test_short_sparsify_x_partial_keeps_subset", + "eval.tests.test_parameter_aliases.test_short_threads_t_echoes_thread_count", + "eval.tests.test_parameter_config.test_Hg_filter_default_enabled", + "eval.tests.test_parameter_config.test_block_length_above_segment_echoed", + "eval.tests.test_parameter_config.test_block_length_below_segment_no_filtering", + "eval.tests.test_parameter_config.test_chain_gap_default_equals_segment", + "eval.tests.test_parameter_config.test_chain_gap_override", + "eval.tests.test_parameter_config.test_default_config_echoed", + "eval.tests.test_parameter_config.test_default_output_file_is_mashmap_dot_out", + "eval.tests.test_parameter_config.test_dense_mode_computes_sketch_size", + "eval.tests.test_parameter_config.test_filter_mode_none_disables_Hg", + "eval.tests.test_parameter_config.test_kmer_complexity_line_hidden_by_default", + "eval.tests.test_parameter_config.test_kmer_complexity_line_shown_when_set", + "eval.tests.test_parameter_config.test_kmer_size_override", + "eval.tests.test_parameter_config.test_no_Hg_filter_disables", + "eval.tests.test_parameter_config.test_nosplit_disables_read_split", + "eval.tests.test_parameter_config.test_output_flag_controls_output_file", + "eval.tests.test_parameter_config.test_percent_identity_override_is_scaled", + "eval.tests.test_parameter_config.test_segment_length_override_appears", + "eval.tests.test_parameter_config.test_sketch_size_override", + "eval.tests.test_parameter_config.test_skip_prefix_disabled_by_default", + "eval.tests.test_parameter_config.test_skip_prefix_enabled_prints_delimiter", + "eval.tests.test_parameter_config.test_skip_self_default_do_not_skip", + "eval.tests.test_parameter_config.test_skip_self_flag_enables_skip", + "eval.tests.test_parameter_config.test_split_default_reports_read_split_allowed", + "eval.tests.test_parameter_config.test_threads_default_is_one", + "eval.tests.test_parameter_config.test_threads_override", + "eval.tests.test_parser_errors.test_equal_assignment_value_ok", + "eval.tests.test_parser_errors.test_missing_long_option_value", + "eval.tests.test_parser_errors.test_missing_option_value", + "eval.tests.test_parser_errors.test_ref_requires_value_reports_ref", + "eval.tests.test_parser_errors.test_unknown_long_option", + "eval.tests.test_parser_errors.test_unknown_option_reported_before_ref_check", + "eval.tests.test_parser_errors.test_unknown_short_option", + "eval.tests.test_parser_errors.test_value_that_looks_like_option_is_missing_value", + "eval.tests.test_partial_sparsify_and_modes.test_filter_mode_none_disables_filtering_and_keeps_rows", + "eval.tests.test_partial_sparsify_and_modes.test_filter_mode_one_to_one_produces_mapping_rows", + "eval.tests.test_partial_sparsify_and_modes.test_partial_sparsify_is_deterministic_across_runs", + "eval.tests.test_partial_sparsify_and_modes.test_partial_sparsify_keeps_a_subset_of_rows", + "eval.tests.test_partial_sparsify_and_modes.test_partial_sparsify_kept_row_is_an_exact_default_row", + "eval.tests.test_partial_sparsify_and_modes.test_sparsify_monotone_row_counts", + "eval.tests.test_successful_run.test_default_output_has_fourteen_fields", + "eval.tests.test_successful_run.test_legacy_output_format", + "eval.tests.test_successful_run.test_load_index_reuses_saved_index", + "eval.tests.test_successful_run.test_matching_query_line_fields", + "eval.tests.test_successful_run.test_no_merge_adds_jaccard_field", + "eval.tests.test_successful_run.test_no_query_means_self_mapping_all_vs_all", + "eval.tests.test_successful_run.test_query_list_accepts_multiple_files", + "eval.tests.test_successful_run.test_query_vs_nonmatching_produces_no_rows", + "eval.tests.test_successful_run.test_reference_list_parses_multi_file", + "eval.tests.test_successful_run.test_report_percentage_scales_identity_field", + "eval.tests.test_successful_run.test_save_index_creates_map_and_index_files", + "eval.tests.test_successful_run.test_stderr_prints_reference_and_query_names", + "eval.tests.test_successful_run.test_stderr_reports_mapping_summary", + "eval.tests.test_successful_run.test_successful_run_generates_mapping_output", + "eval.tests.test_successful_run.test_two_reference_contigs_both_indexed", + "eval.tests.test_target_filter_options.test_sparsify_one_keeps_all_rows_equal_default", + "eval.tests.test_target_filter_options.test_target_list_and_prefix_parse_together", + "eval.tests.test_target_filter_options.test_target_list_missing_file_parses_clean", + "eval.tests.test_target_filter_options.test_target_list_real_filter_file_parses", + "eval.tests.test_target_filter_options.test_target_prefix_matching_contig_leaves_config_unchanged", + "eval.tests.test_validation_errors.test_ani_diff_in_range_accepted[0]", + "eval.tests.test_validation_errors.test_ani_diff_in_range_accepted[100]", + "eval.tests.test_validation_errors.test_ani_diff_in_range_accepted[50]", + "eval.tests.test_validation_errors.test_ani_diff_in_range_accepted[5]", + "eval.tests.test_validation_errors.test_ani_diff_out_of_range_rejected[-0.1]", + "eval.tests.test_validation_errors.test_ani_diff_out_of_range_rejected[101]", + "eval.tests.test_validation_errors.test_ani_diff_out_of_range_rejected[200]", + "eval.tests.test_validation_errors.test_hg_conf_out_of_range_rejected[-1]", + "eval.tests.test_validation_errors.test_hg_conf_out_of_range_rejected[100.5]", + "eval.tests.test_validation_errors.test_hg_conf_out_of_range_rejected[101]", + "eval.tests.test_validation_errors.test_invalid_filter_mode_rejected[1]", + "eval.tests.test_validation_errors.test_invalid_filter_mode_rejected[MAP]", + "eval.tests.test_validation_errors.test_invalid_filter_mode_rejected[]", + "eval.tests.test_validation_errors.test_invalid_filter_mode_rejected[banana]", + "eval.tests.test_validation_errors.test_invalid_filter_mode_rejected[o2o]", + "eval.tests.test_validation_errors.test_missing_query_file_validated_before_reference", + "eval.tests.test_validation_errors.test_missing_reference_file_validated_after_parse", + "eval.tests.test_validation_errors.test_missing_reflist_file_reported", + "eval.tests.test_validation_errors.test_negative_block_length_rejected", + "eval.tests.test_validation_errors.test_negative_chain_gap_rejected", + "eval.tests.test_validation_errors.test_negative_num_mappings_short_seq_wraps", + "eval.tests.test_validation_errors.test_negative_num_mappings_wraps_to_uint32", + "eval.tests.test_validation_errors.test_no_args_requires_reference", + "eval.tests.test_validation_errors.test_num_mappings_for_segment_positive_accepted[100]", + "eval.tests.test_validation_errors.test_num_mappings_for_segment_positive_accepted[1]", + "eval.tests.test_validation_errors.test_num_mappings_for_segment_positive_accepted[5]", + "eval.tests.test_validation_errors.test_num_mappings_for_segment_zero_rejected[0]", + "eval.tests.test_validation_errors.test_num_mappings_for_short_seq_zero_rejected[0]", + "eval.tests.test_validation_errors.test_percent_identity_at_or_above_50_accepted[100]", + "eval.tests.test_validation_errors.test_percent_identity_at_or_above_50_accepted[50]", + "eval.tests.test_validation_errors.test_percent_identity_at_or_above_50_accepted[51]", + "eval.tests.test_validation_errors.test_percent_identity_at_or_above_50_accepted[85]", + "eval.tests.test_validation_errors.test_percent_identity_below_50_rejected[0]", + "eval.tests.test_validation_errors.test_percent_identity_below_50_rejected[1]", + "eval.tests.test_validation_errors.test_percent_identity_below_50_rejected[49.9]", + "eval.tests.test_validation_errors.test_percent_identity_below_50_rejected[49]", + "eval.tests.test_validation_errors.test_ref_alone_clears_reference_guard", + "eval.tests.test_validation_errors.test_segment_length_at_or_above_minimum_accepted[100000]", + "eval.tests.test_validation_errors.test_segment_length_at_or_above_minimum_accepted[100]", + "eval.tests.test_validation_errors.test_segment_length_at_or_above_minimum_accepted[200]", + "eval.tests.test_validation_errors.test_segment_length_at_or_above_minimum_accepted[5000]", + "eval.tests.test_validation_errors.test_segment_length_below_minimum_rejected[-100]", + "eval.tests.test_validation_errors.test_segment_length_below_minimum_rejected[0]", + "eval.tests.test_validation_errors.test_segment_length_below_minimum_rejected[1]", + "eval.tests.test_validation_errors.test_segment_length_below_minimum_rejected[50]", + "eval.tests.test_validation_errors.test_segment_length_below_minimum_rejected[99]", + "eval.tests.test_validation_errors.test_valid_filter_modes_mapped_to_enum[map-Filter mode = 1]", + "eval.tests.test_validation_errors.test_valid_filter_modes_mapped_to_enum[none-Filter mode = 3]", + "eval.tests.test_validation_errors.test_valid_filter_modes_mapped_to_enum[one-to-one-Filter mode = 2]", + "eval.tests.test_version_help.test_help_lists_available_options", + "eval.tests.test_version_help.test_help_long_prints_usage_to_stderr", + "eval.tests.test_version_help.test_help_short_prints_usage_to_stderr", + "eval.tests.test_version_help.test_help_writes_no_stdout", + "eval.tests.test_version_help.test_version_long_option_prints_version_exit_zero", + "eval.tests.test_version_help.test_version_present_even_with_no_ref_arg", + "eval.tests.test_version_help.test_version_short_option_prints_version_exit_zero", + "eval.tests.test_version_help.test_version_writes_no_stdout" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.test_help_exactly_matches_golden[--help]", + "eval.tests.test_cli.test_help_exactly_matches_golden[-h]", + "eval.tests.test_cli.test_hg_ani_diff_out_of_range_rejected[-1]", + "eval.tests.test_cli.test_hg_ani_diff_out_of_range_rejected[101]", + "eval.tests.test_cli.test_hg_ani_diff_out_of_range_rejected[150]", + "eval.tests.test_cli.test_invalid_filter_mode_is_rejected", + "eval.tests.test_cli.test_missing_reference_file_fails_validation", + "eval.tests.test_cli.test_multi_kmer_variants_make_distinct_sketches", + "eval.tests.test_cli.test_negative_block_length_rejected[-10.5]", + "eval.tests.test_cli.test_negative_block_length_rejected[-100]", + "eval.tests.test_cli.test_negative_block_length_rejected[-1]", + "eval.tests.test_cli.test_negative_block_length_rejected[-5]", + "eval.tests.test_cli.test_negative_chain_gap_rejected[-100]", + "eval.tests.test_cli.test_negative_chain_gap_rejected[-1]", + "eval.tests.test_cli.test_no_arguments_requests_reference", + "eval.tests.test_cli.test_num_mappings_segment_zero_rejected", + "eval.tests.test_cli.test_perc_identity_below_minimum_rejected[0]", + "eval.tests.test_cli.test_perc_identity_below_minimum_rejected[10]", + "eval.tests.test_cli.test_perc_identity_below_minimum_rejected[49]", + "eval.tests.test_cli.test_query_list_parsed_as_query", + "eval.tests.test_cli.test_reflist_file_parsed_as_reference", + "eval.tests.test_cli.test_seg_length_below_minimum_rejected[1]", + "eval.tests.test_cli.test_seg_length_below_minimum_rejected[49]", + "eval.tests.test_cli.test_seg_length_below_minimum_rejected[50]", + "eval.tests.test_cli.test_version_prints_short_version[--version]", + "eval.tests.test_cli.test_version_prints_short_version[-v]", + "eval.tests.test_sketch_build.test_dense_sketch_keeps_more_windows", + "eval.tests.test_sketch_build.test_sketch_build_is_parallel_deterministic", + "eval.tests.test_sketch_build.test_sketch_build_reports_nonzero_windows", + "eval.tests.test_sketch_build.test_sketch_kmer_size_changes_window_selection[19-2054-1117]", + "eval.tests.test_sketch_build.test_sketch_kmer_size_changes_window_selection[25-155-97]", + "eval.tests.test_sketch_build.test_sketch_kmer_size_changes_window_selection[31-161-102]", + "eval.tests.test_sketch_build.test_sketch_of_multiple_sequences_indexes_all", + "eval.tests.test_sketch_build.test_sketch_size_controls_number_of_windows[100-1580]", + "eval.tests.test_sketch_build.test_sketch_size_controls_number_of_windows[20-325]", + "eval.tests.test_sketch_build.test_sketch_winnowing_window_is_segment_length", + "eval.tests.test_sketch_edges.test_dense_sketch_diagnostics_match_expected", + "eval.tests.test_sketch_edges.test_empty_reference_fails_before_index", + "eval.tests.test_sketch_edges.test_freq_histogram_reports_minmax_interval_points", + "eval.tests.test_sketch_edges.test_freq_threshold_changes_ignore_decision[0.001-[mashmap::skch::Sketch::computeFreqHist] With threshold 0.001%, consider all minmers during lookup.]", + "eval.tests.test_sketch_edges.test_freq_threshold_changes_ignore_decision[10-[mashmap::skch::Sketch::computeFreqHist] With threshold 10%, ignore minmers occurring >= 8 times during lookup.]", + "eval.tests.test_sketch_edges.test_freq_threshold_changes_ignore_decision[50-[mashmap::skch::Sketch::computeFreqHist] With threshold 50%, ignore minmers occurring >= 4 times during lookup.]", + "eval.tests.test_sketch_edges.test_freq_threshold_changes_ignore_decision[90-[mashmap::skch::Sketch::computeFreqHist] With threshold 90%, ignore minmers occurring >= 4 times during lookup.]", + "eval.tests.test_sketch_edges.test_reference_with_only_short_sequences_indexes_zero", + "eval.tests.test_sketch_edges.test_sketch_diagnostics_go_to_stderr", + "eval.tests.test_sketch_edges.test_target_list_selects_contigs[targets_both.txt-expected1]", + "eval.tests.test_sketch_edges.test_target_list_selects_contigs[targets_one.txt-expected0]", + "eval.tests.test_sketch_edges.test_target_list_unknown_names_are_skipped", + "eval.tests.test_sketch_edges.test_target_prefix_matching_all_contigs_is_unchanged", + "eval.tests.test_sketch_edges.test_target_prefix_matching_nothing_makes_empty_sketch", + "eval.tests.test_sketch_edges.test_target_prefix_matching_one_contig_keeps_only_that_contig", + "eval.tests.test_sketch_freq_drop.test_additional_sketch_sizes_cap_windows[200-3138]", + "eval.tests.test_sketch_freq_drop.test_additional_sketch_sizes_cap_windows[40-640]", + "eval.tests.test_sketch_freq_drop.test_additional_winnowing_windows_yield_distinct_sketches[1000-821-563]", + "eval.tests.test_sketch_freq_drop.test_additional_winnowing_windows_yield_distinct_sketches[3000-3409-1894]", + "eval.tests.test_sketch_freq_drop.test_default_mapping_reports_exact_reference_interval", + "eval.tests.test_sketch_freq_drop.test_freq_seed_drop_changes_mapping_coordinates", + "eval.tests.test_sketch_freq_drop.test_low_threshold_keeps_default_mapping", + "eval.tests.test_sketch_freq_drop.test_save_then_load_with_freq_drop_is_stateful", + "eval.tests.test_sketch_freq_on_varied_kmer.test_freq_threshold_cutoff_tracks_kmer_sketch[13-50-1265-[mashmap::skch::Sketch::computeFreqHist] Frequency histogram of minmer interval points = (2, 605) ... (36, 1)-[mashmap::skch::Sketch::computeFreqHist] With threshold 50%, ignore minmers occurring >= 4 times during lookup.]", + "eval.tests.test_sketch_freq_on_varied_kmer.test_freq_threshold_cutoff_tracks_kmer_sketch[25-10-155-[mashmap::skch::Sketch::computeFreqHist] Frequency histogram of minmer interval points = (2, 72) ... (10, 1)-[mashmap::skch::Sketch::computeFreqHist] With threshold 10%, ignore minmers occurring >= 6 times during lookup.]", + "eval.tests.test_sketch_freq_on_varied_kmer.test_freq_threshold_cutoff_tracks_kmer_sketch[25-50-155-[mashmap::skch::Sketch::computeFreqHist] Frequency histogram of minmer interval points = (2, 72) ... (10, 1)-[mashmap::skch::Sketch::computeFreqHist] With threshold 50%, ignore minmers occurring >= 4 times during lookup.]", + "eval.tests.test_sketch_freq_on_varied_kmer.test_freq_threshold_cutoff_tracks_kmer_sketch[35-100-159-[mashmap::skch::Sketch::computeFreqHist] Frequency histogram of minmer interval points = (2, 77) ... (8, 5)-[mashmap::skch::Sketch::computeFreqHist] With threshold 100%, ignore minmers occurring >= 2 times during lookup.]", + "eval.tests.test_sketch_freq_on_varied_kmer.test_k35_threshold_100_maps_without_error", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_100_stress_drops_nearly_all_mappers", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[0.05-[mashmap::skch::Sketch::computeFreqHist] With threshold 0.05%, consider all minmers during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[0.1-[mashmap::skch::Sketch::computeFreqHist] With threshold 0.1%, ignore minmers occurring >= 44 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[100-[mashmap::skch::Sketch::computeFreqHist] With threshold 100%, ignore minmers occurring >= 2 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[12-[mashmap::skch::Sketch::computeFreqHist] With threshold 12%, ignore minmers occurring >= 6 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[2-[mashmap::skch::Sketch::computeFreqHist] With threshold 2%, ignore minmers occurring >= 20 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[3-[mashmap::skch::Sketch::computeFreqHist] With threshold 3%, ignore minmers occurring >= 16 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[6-[mashmap::skch::Sketch::computeFreqHist] With threshold 6%, ignore minmers occurring >= 12 times during lookup.]", + "eval.tests.test_sketch_freq_threshold_rows.test_kmer_threshold_distinct_frequency_decisions[8-[mashmap::skch::Sketch::computeFreqHist] With threshold 8%, ignore minmers occurring >= 10 times during lookup.]", + "eval.tests.test_sketch_index_files.test_load_index_binary_uses_loaded_poslist_for_freq", + "eval.tests.test_sketch_index_files.test_load_index_round_trip_reproduces_sketch[bin]", + "eval.tests.test_sketch_index_files.test_load_index_round_trip_reproduces_sketch[noext]", + "eval.tests.test_sketch_index_files.test_load_index_round_trip_reproduces_sketch[tsv]", + "eval.tests.test_sketch_index_files.test_save_index_binary_creates_index_and_map", + "eval.tests.test_sketch_index_files.test_save_index_is_parallel_and_reproducible", + "eval.tests.test_sketch_index_files.test_save_index_tsv_creates_tsv_and_mapsidecar", + "eval.tests.test_sketch_index_files.test_save_index_tsv_has_header_and_matching_rows", + "eval.tests.test_sketch_index_files.test_save_index_tsv_rows_are_well_formed[-1]", + "eval.tests.test_sketch_index_files.test_save_index_tsv_rows_are_well_formed[0]", + "eval.tests.test_sketch_index_files.test_save_index_tsv_rows_are_well_formed[1]", + "eval.tests.test_sketch_index_files.test_save_index_tsv_rows_are_well_formed[2]", + "eval.tests.test_sketch_index_files.test_save_index_tsv_seqid_spans_all_contigs", + "eval.tests.test_sketch_index_files.test_tsv_and_binary_save_produce_identical_poslist", + "eval.tests.test_sketch_index_stateful.test_load_index_overrides_reference_build", + "eval.tests.test_sketch_index_stateful.test_stateful_dense_k25_save_then_load_round_trip", + "eval.tests.test_sketch_index_stateful.test_stateful_dense_save_then_load_round_trip", + "eval.tests.test_sketch_index_stateful.test_stateful_load_index_with_freq_drop_round_trip", + "eval.tests.test_sketch_index_stateful.test_stateful_multifile_reflist_save_then_load", + "eval.tests.test_sketch_input_formats.test_fastq_reference_is_sketched_to_one_contig_block", + "eval.tests.test_sketch_input_formats.test_fastq_reference_named_in_config_banner", + "eval.tests.test_sketch_input_formats.test_gzipped_query_maps_without_error", + "eval.tests.test_sketch_input_formats.test_gzipped_reference_and_query_together", + "eval.tests.test_sketch_input_formats.test_gzipped_reference_produces_identical_sketch", + "eval.tests.test_sketch_input_formats.test_multifile_reflist_indexes_all_reference_files", + "eval.tests.test_sketch_input_formats.test_reflist_three_files_accumulate_windows", + "eval.tests.test_sketch_mixed_length_reference.test_mixed_length_reference_indexes_long_contig_only", + "eval.tests.test_sketch_mixed_length_reference.test_mixed_reference_more_short_records_same_block", + "eval.tests.test_sketch_mixed_length_reference.test_stateful_mixed_reference_save_then_load_round_trip", + "eval.tests.test_sketch_param_matrix.test_dense_plus_kmer_raw_window_counts", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[J150]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[J60]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[dense_k15]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[dense_k25]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k13]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k15]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k17]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k27]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k29]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[k35]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[seg2000]", + "eval.tests.test_sketch_param_matrix.test_distinct_sketch_config_reports_exact_block[seg8000]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[13-1265]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[15-1108]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[17-1580]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[27-151]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[29-160]", + "eval.tests.test_sketch_param_matrix.test_kmer_monotonic_window_sweep[35-159]", + "eval.tests.test_sketch_target_filter_composition.test_ref_list_with_target_list_filters_across_files", + "eval.tests.test_sketch_target_filter_composition.test_ref_list_with_target_prefix_filters_across_files", + "eval.tests.test_sketch_target_filter_composition.test_stateful_filtered_index_load_overrides_unrelated_reference", + "eval.tests.test_sketch_target_filter_composition.test_stateful_filtered_index_save_then_load_round_trip", + "eval.tests.test_sketch_target_filter_composition.test_target_prefix_contradicts_target_list_yields_empty_sketch", + "eval.tests.test_sketch_target_filter_composition.test_target_prefix_wildcard_with_target_list_selects_single_contig" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_validation.TestHelp.test_help_exit_zero[--help]", + "eval.tests.test_cli_validation.TestHelp.test_help_exit_zero[-h]", + "eval.tests.test_cli_validation.TestHelp.test_help_lists_core_options", + "eval.tests.test_cli_validation.TestInputFileErrors.test_empty_query_file_rejected", + "eval.tests.test_cli_validation.TestInputFileErrors.test_empty_reference_file_rejected", + "eval.tests.test_cli_validation.TestInputFileErrors.test_missing_reference_file", + "eval.tests.test_cli_validation.TestInputFileErrors.test_missing_reflist_file", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[ANI difference must be between 0 and 100_0]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[ANI difference must be between 0 and 100_1]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[ANI difference must be between 0 and 100_2]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[Invalid option given for filter_mode]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[chain gap has to be a float value greater than or equal to 0]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[hypergeometric confidence must be between 0 and 100]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[min block length has to be a float value greater than or equal to 0]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[minimum nucleotide identity requirement should be >= 50%]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[minimum segment length is required to be >= 100_0]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[minimum segment length is required to be >= 100_1]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[the number of mappings to retain for each segment has to be greater than 0]", + "eval.tests.test_cli_validation.TestOptionValidation.test_invalid_option_value_rejected[the number of mappings to retain for each sequence shorter than segment length]", + "eval.tests.test_cli_validation.TestParameterEcho.test_parameters_echoed_to_stderr", + "eval.tests.test_cli_validation.TestPercentIdentityBoundary.test_perc_id_50_is_accepted", + "eval.tests.test_cli_validation.TestPercentIdentityBoundary.test_perc_id_below_50_is_rejected", + "eval.tests.test_cli_validation.TestReferenceRequirement.test_missing_reference_is_error", + "eval.tests.test_cli_validation.TestReferenceRequirement.test_reference_via_refList_flag", + "eval.tests.test_cli_validation.TestVersion.test_version_does_not_require_files", + "eval.tests.test_cli_validation.TestVersion.test_version_reports_semver[--version]", + "eval.tests.test_cli_validation.TestVersion.test_version_reports_semver[-v]", + "eval.tests.test_commonfunc_extremes.TestEmptyQuerySketch.test_alln_against_selfcomp_also_empty", + "eval.tests.test_commonfunc_extremes.TestEmptyQuerySketch.test_alln_query_unmapped_and_qualified[3000]", + "eval.tests.test_commonfunc_extremes.TestEmptyQuerySketch.test_alln_query_unmapped_and_qualified[6000]", + "eval.tests.test_commonfunc_extremes.TestEmptyQuerySketch.test_control_valid_query_maps", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_no_hg_filter_disables_delta_arm", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_nonzero_delta_deterministic_window", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_nonzero_delta_on_selfcomp_keeps_two_rows", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_nonzero_delta_preserves_mapping_and_echoes_scaled[0.01]", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_nonzero_delta_preserves_mapping_and_echoes_scaled[0.05]", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_nonzero_delta_preserves_mapping_and_echoes_scaled[0.1]", + "eval.tests.test_commonfunc_extremes.TestHgFilterAniDiff.test_zero_delta_reports_zero_and_maps", + "eval.tests.test_commonfunc_normalization.TestAmbiguityKmerGating.test_early_n_gates_leading_kmers_but_keeps_mapping", + "eval.tests.test_commonfunc_normalization.TestAmbiguityKmerGating.test_identity_drops_monotonically_with_more_ambiguity", + "eval.tests.test_commonfunc_normalization.TestAmbiguityKmerGating.test_mid_n_gates_window_and_drops_identity", + "eval.tests.test_commonfunc_normalization.TestAmbiguousBases.test_iupac_codes_normalized_to_valid_dna", + "eval.tests.test_commonfunc_normalization.TestAmbiguousBases.test_n_bearing_reverse_complement_maps_minus_strand", + "eval.tests.test_commonfunc_normalization.TestLowerCaseNormalization.test_lowercase_query_uppercased_before_hashing", + "eval.tests.test_commonfunc_normalization.TestLowerCaseNormalization.test_mixed_case_matches_uppercase_control", + "eval.tests.test_commonfunc_normalization.TestReferenceAmbiguity.test_reference_ambiguity_preserves_plain_query_mapping", + "eval.tests.test_commonfunc_normalization.TestReferenceAmbiguity.test_scattered_n_in_reference_still_indexes", + "eval.tests.test_commonfunc_repeat.TestIndexSaveLoadRoundTrip.test_load_index_reproduces_mapping", + "eval.tests.test_commonfunc_repeat.TestIndexSaveLoadRoundTrip.test_save_index_produces_map_and_index_files", + "eval.tests.test_commonfunc_repeat.TestIndexSaveLoadRoundTrip.test_tsv_index_round_trip", + "eval.tests.test_commonfunc_repeat.TestKmerComplexityGating.test_high_complexity_read_survives_intermediate_threshold", + "eval.tests.test_commonfunc_repeat.TestKmerComplexityGating.test_low_complexity_repeat_read_dropped_at_high_threshold", + "eval.tests.test_commonfunc_repeat.TestKmerComplexityGating.test_low_complexity_repeat_read_kept_at_zero_threshold", + "eval.tests.test_commonfunc_repeat.TestLowComplexitySketchContrast.test_low_complexity_ref_has_far_fewer_unique_minmers", + "eval.tests.test_commonfunc_repeat.TestLowerTriangular.test_lower_triangular_drops_self_mappings", + "eval.tests.test_commonfunc_repeat.TestLowerTriangular.test_without_lower_triangular_reports_self_mappings", + "eval.tests.test_commonfunc_repeat.TestNoHgFilter.test_default_uses_hypergeometric_filter", + "eval.tests.test_commonfunc_repeat.TestNoHgFilter.test_no_hg_filter_toggles_parameter_and_still_maps", + "eval.tests.test_commonfunc_repeat.TestRepeatReferenceMapping.test_repeat_query_full_identity_forward", + "eval.tests.test_commonfunc_repeat.TestRepeatReferenceMapping.test_repeat_query_is_deterministic", + "eval.tests.test_commonfunc_repeat.TestRepeatReferenceMapping.test_repeat_reference_forces_kmer_collapse", + "eval.tests.test_commonfunc_repeat.TestRepeatReferenceMapping.test_repeat_reverse_complement_full_identity", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompIndexRoundTrip.test_saved_index_reproduces_mapping", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompIndexRoundTrip.test_tsv_index_round_trip", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompKmerComplexity.test_dropped_at_high_threshold", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompKmerComplexity.test_echoes_raised_threshold", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompKmerComplexity.test_survives_intermediate_threshold", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_mapping_matches_golden", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_reference_locus_is_identical_for_both_segments", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_reverse_segment_covers_query_tail", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_sketch_size_keeps_two_rows_but_changes_kc[130]", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_sketch_size_keeps_two_rows_but_changes_kc[30]", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_sketch_size_keeps_two_rows_but_changes_kc[50]", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompMapping.test_two_rows_forward_and_reverse", + "eval.tests.test_commonfunc_selfcomp.TestSelfCompUnrelatedQuery.test_unrelated_query_reports_zero", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixDelimiterAndEcho.test_delimiter_echoed_on_stderr", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixDelimiterAndEcho.test_multiple_delimiters_keep_survive[.]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixDelimiterAndEcho.test_multiple_delimiters_keep_survive[:]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixDelimiterAndEcho.test_multiple_delimiters_keep_survive[_]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedDrops.test_drop_reports_zero_tally", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedDrops.test_same_prefix_mapping_dropped", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedDrops.test_same_prefix_mapping_present_without_flag", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_cross_group_mapping_preserved_without_flag", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_cross_group_mapping_survives_golden", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_short_flag_alias_y", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_survives_across_seg_length[1500]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_survives_across_seg_length[3000]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_survives_across_seg_length[4500]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_survives_across_sketch_size[130]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_survives_across_sketch_size[30]", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixGroupedSurvives.test_surviving_row_columns", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixIndexRoundTrip.test_index_roundtrip_preserves_cross_group_mapping", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixIndexRoundTrip.test_tsv_index_roundtrip_cross_group", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixKmerComplexity.test_combo_drops_at_high_threshold", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixKmerComplexity.test_combo_keeps_survive_at_low_threshold", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixKmerComplexity.test_same_prefix_query_never_targets_other_group", + "eval.tests.test_commonfunc_skipprefix.TestSkipPrefixKmerComplexity.test_surviving_query_maps_only_to_own_contig", + "eval.tests.test_filter_ref.TestRefFilterBoundaryShift.test_boundary_shift_stable_under_secondary_count", + "eval.tests.test_filter_ref.TestRefFilterBoundaryShift.test_tail_mapping_shifts_end_past_contig", + "eval.tests.test_filter_ref.TestRefFilterEarlyReturn.test_single_mapping_group_early_returns", + "eval.tests.test_filter_ref.TestRefFilterEarlyReturn.test_tail_only_mapping_also_early_returns", + "eval.tests.test_filter_ref.TestRefFilterMarkGoodBreak.test_best_score_survives_budget", + "eval.tests.test_filter_ref.TestRefFilterMarkGoodBreak.test_overlapping_secondary_does_not_evict_best", + "eval.tests.test_filters.TestAllVsAllDefaults.test_query_equals_reference_reports_self_mapping", + "eval.tests.test_filters.TestAllVsAllDefaults.test_query_equals_reference_with_skip_self_empties", + "eval.tests.test_filters.TestFilterModes.test_filter_abbreviation_f_works", + "eval.tests.test_filters.TestFilterModes.test_modes_report_all_mappings[map-expect0]", + "eval.tests.test_filters.TestFilterModes.test_modes_report_all_mappings[none-expect1]", + "eval.tests.test_filters.TestFilterModes.test_one_to_one_drops_duplicate_mapping", + "eval.tests.test_filters.TestFilterModes.test_one_to_one_vs_map_difference_is_real", + "eval.tests.test_filters.TestNumMappingsForSegment.test_default_keeps_single_copy_of_duplicate_pair", + "eval.tests.test_filters.TestNumMappingsForSegment.test_one_to_one_collapses_exact_duplicate_across_secondary_counts", + "eval.tests.test_filters.TestSeedGatingFlags.test_drop_low_map_id_keeps_high_identity_mapping", + "eval.tests.test_filters.TestSeedGatingFlags.test_skip_self_removes_self_mapping", + "eval.tests.test_filters.TestSeedGatingFlags.test_skip_self_short_flag_X", + "eval.tests.test_filters.TestSeedGatingFlags.test_without_skip_self_self_mapping_is_reported", + "eval.tests.test_filters.TestSkipPrefix.test_skip_prefix_drops_same_prefix_mapping", + "eval.tests.test_filters.TestSkipPrefix.test_skip_prefix_short_flag_Y", + "eval.tests.test_filters.TestSkipPrefix.test_without_skip_prefix_same_prefix_mapping_reported", + "eval.tests.test_filters.TestSparsify.test_sparsify_fraction_one_keeps_all", + "eval.tests.test_filters.TestSparsify.test_sparsify_fraction_zero_keeps_none", + "eval.tests.test_filters.TestSparsify.test_sparsify_keeps_subset_of_mappings", + "eval.tests.test_filters.TestTargetFiltering.test_target_list_restricts_reference_contigs", + "eval.tests.test_filters.TestTargetFiltering.test_target_prefix_keeps_matching_reference_contigs", + "eval.tests.test_identity_gate.TestIdentityGateEcho.test_threshold_echoed_across_modes", + "eval.tests.test_identity_gate.TestIdentityGatePermissive.test_combined_keeps_all_at_default_threshold", + "eval.tests.test_identity_gate.TestIdentityGatePermissive.test_overlap_keeps_both_at_default_threshold", + "eval.tests.test_identity_gate.TestIdentityGateStrict.test_combined_keeps_two_high_identity_mappings", + "eval.tests.test_identity_gate.TestIdentityGateStrict.test_overlap_drops_divergent_mapping", + "eval.tests.test_inputs.TestFastqIndexFastPath.test_missing_fai_triggers_slow_path_warning", + "eval.tests.test_inputs.TestFastqIndexFastPath.test_multi_record_fai_fastpath_reads_all_lengths", + "eval.tests.test_inputs.TestFastqIndexFastPath.test_provided_fai_suppresses_warning", + "eval.tests.test_inputs.TestInputVariants.test_empty_query_file_is_an_error", + "eval.tests.test_inputs.TestInputVariants.test_gzip_query_input", + "eval.tests.test_inputs.TestInputVariants.test_multi_sequence_query_file_maps_each", + "eval.tests.test_inputs.TestInputVariants.test_short_sequence_dropped_from_qualified", + "eval.tests.test_inputs.TestListFiles.test_reference_and_query_lists", + "eval.tests.test_inputs.TestMiscFlags.test_filter_length_mismatches_flag_accepted", + "eval.tests.test_inputs.TestReverseStrandInMulti.test_rc_member_gets_minus_strand", + "eval.tests.test_mapping.TestDivergedQuery.test_diverged_query_identity_below_one", + "eval.tests.test_mapping.TestForwardStrandMapping.test_block_length_equals_max_query_ref_span", + "eval.tests.test_mapping.TestForwardStrandMapping.test_identical_query_covered_window_on_reference", + "eval.tests.test_mapping.TestForwardStrandMapping.test_identical_query_identity_and_mapq", + "eval.tests.test_mapping.TestForwardStrandMapping.test_identical_query_maps_forward_strand", + "eval.tests.test_mapping.TestForwardStrandMapping.test_identity_and_origin_fields_present", + "eval.tests.test_mapping.TestReverseComplement.test_rc_identity_is_full", + "eval.tests.test_mapping.TestReverseComplement.test_reverse_complement_query_maps_reverse_strand", + "eval.tests.test_mapping.TestSegLengthFragmentation.test_default_seg_length_is_5000", + "eval.tests.test_mapping.TestSegLengthFragmentation.test_seg_length_reflected_in_config", + "eval.tests.test_mapping.TestSketchParameters.test_default_sketch_size_is_printed", + "eval.tests.test_mapping.TestSketchParameters.test_dense_sketching_alters_sketch_size", + "eval.tests.test_mapping.TestSketchParameters.test_kmer_option_accepted_and_changes_report", + "eval.tests.test_mapping.TestSketchParameters.test_sketch_size_option_changes_conserved_sketches", + "eval.tests.test_mapping.TestUnrelatedQuery.test_unrelated_query_produces_no_mapping", + "eval.tests.test_mapping.TestUnrelatedQuery.test_unrelated_query_reports_zero_mapped_reads", + "eval.tests.test_output_formats.TestAniPercentage.test_default_identity_is_fraction", + "eval.tests.test_output_formats.TestAniPercentage.test_report_percentage_scales_identity_to_100", + "eval.tests.test_output_formats.TestDefaultOutputFile.test_default_output_file_is_mashmap_out", + "eval.tests.test_output_formats.TestDefaultOutputFile.test_explicit_output_path_respected", + "eval.tests.test_output_formats.TestJcField.test_jc_field_absent_with_merge", + "eval.tests.test_output_formats.TestJcField.test_jc_field_present_without_merge", + "eval.tests.test_output_formats.TestLegacyFormat.test_legacy_inclusive_end_coordinates", + "eval.tests.test_output_formats.TestLegacyFormat.test_legacy_reports_percent_nuc_identity", + "eval.tests.test_output_formats.TestLegacyFormat.test_legacy_uses_space_separators", + "eval.tests.test_output_formats.TestModernFormat.test_half_open_coordinates_reported", + "eval.tests.test_output_formats.TestModernFormat.test_tab_delimited_and_column_contract", + "eval.tests.test_rc_split_merge.TestRcChainGap.test_default_chain_gap_merges_reverse_to_one", + "eval.tests.test_rc_split_merge.TestRcChainGap.test_small_chain_gap_leaves_reverse_fragments_unchained", + "eval.tests.test_rc_split_merge.TestRcSplitMerge.test_long_rc_merged_into_single_reverse_row", + "eval.tests.test_rc_split_merge.TestRcSplitMerge.test_long_rc_no_merge_keeps_three_reverse_fragments", + "eval.tests.test_rc_split_merge.TestRcSplitMerge.test_rc_merge_is_deterministic", + "eval.tests.test_rc_split_merge.TestRcStrandSibling.test_reverse_and_forward_siblings_map_opposite_strands", + "eval.tests.test_report_scaling_and_legacy.TestLegacyReverseStrand.test_legacy_forward_and_reverse_siblings_opposite_strands", + "eval.tests.test_report_scaling_and_legacy.TestLegacyReverseStrand.test_legacy_merge_vs_nomerge_drops_jc", + "eval.tests.test_report_scaling_and_legacy.TestLegacyReverseStrand.test_legacy_reverse_strand_pins_minus_and_inclusive_ends", + "eval.tests.test_report_scaling_and_legacy.TestReportPercentageScaling.test_divergent_identity_default_fraction", + "eval.tests.test_report_scaling_and_legacy.TestReportPercentageScaling.test_divergent_identity_scaled_to_percent", + "eval.tests.test_report_scaling_and_legacy.TestReportPercentageScaling.test_percent_and_fraction_tail_both_100", + "eval.tests.test_split_merge.TestBlockLengthFiltering.test_block_length_above_seg_length_reports_min", + "eval.tests.test_split_merge.TestBlockLengthFiltering.test_block_length_equal_seg_length_reports_no_filtering", + "eval.tests.test_split_merge.TestChainGap.test_default_chain_gap_merges_fragments", + "eval.tests.test_split_merge.TestChainGap.test_small_chain_gap_leaves_fragments_unchained", + "eval.tests.test_split_merge.TestChainGap.test_wider_chain_gap_never_reports_more_lines", + "eval.tests.test_split_merge.TestSplitMerging.test_long_query_merged_into_single_mapping", + "eval.tests.test_split_merge.TestSplitMerging.test_merge_reduces_fragment_count", + "eval.tests.test_split_merge.TestSplitMerging.test_no_merge_keeps_fragment_mappings", + "eval.tests.test_split_merge.TestSplitMerging.test_no_split_treats_long_query_as_single" + ] + }, + "generated_module_05": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipprefix_banner_and_absent_delimiter", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_pool_skip_prefix_target_sparsify.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipself_and_skipprefix_compose", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_pool_skip_prefix_target_sparsify.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_validation.test_help_documents_thread_option_exactly", + "eval.tests.test_cli_validation.test_help_exactly_matches_golden", + "eval.tests.test_cli_validation.test_help_short_and_long_flags_emit_identical_golden", + "eval.tests.test_cli_validation.test_invalid_filter_mode_rejected", + "eval.tests.test_cli_validation.test_missing_option_value_reports_missing_value", + "eval.tests.test_cli_validation.test_missing_query_file_reports_could_not_open", + "eval.tests.test_cli_validation.test_missing_reference_file_reports_could_not_open", + "eval.tests.test_cli_validation.test_negative_chain_gap_rejected", + "eval.tests.test_cli_validation.test_no_arguments_reports_reference_missing", + "eval.tests.test_cli_validation.test_num_mappings_per_segment_zero_rejected", + "eval.tests.test_cli_validation.test_num_mappings_short_seq_zero_rejected", + "eval.tests.test_cli_validation.test_perc_identity_below_fifty_rejected", + "eval.tests.test_cli_validation.test_query_omitted_maps_reference_against_itself", + "eval.tests.test_cli_validation.test_query_without_reference_reports_reference_missing", + "eval.tests.test_cli_validation.test_seglength_100_floor_is_accepted", + "eval.tests.test_cli_validation.test_seglength_below_minimum_rejected", + "eval.tests.test_cli_validation.test_threads_flag_accepts_single_digit_boundary[1]", + "eval.tests.test_cli_validation.test_threads_flag_accepts_single_digit_boundary[3]", + "eval.tests.test_cli_validation.test_unknown_short_option_reports_unknown", + "eval.tests.test_cli_validation.test_version_short_and_long_match_golden_exactly", + "eval.tests.test_io_formats.test_default_output_named_mashmap_out", + "eval.tests.test_io_formats.test_filter_none_keeps_every_mapping", + "eval.tests.test_io_formats.test_gzipped_reference_maps_identically_to_plaintext[16]", + "eval.tests.test_io_formats.test_gzipped_reference_maps_identically_to_plaintext[1]", + "eval.tests.test_io_formats.test_gzipped_reference_maps_identically_to_plaintext[4]", + "eval.tests.test_io_formats.test_multifile_reference_list_matches_only_related_contig", + "eval.tests.test_io_formats.test_multithread_reference_list_matches_direct_reference", + "eval.tests.test_io_formats.test_no_fai_query_triggers_index_warning_on_stderr", + "eval.tests.test_io_formats.test_nomatch_and_seglen_warning_do_not_reorder", + "eval.tests.test_io_formats.test_nomerge_adds_jaccard_tag", + "eval.tests.test_io_formats.test_one_to_one_filter_keeps_best_mapping_per_query", + "eval.tests.test_io_formats.test_output_flag_writes_file", + "eval.tests.test_io_formats.test_query_list_input", + "eval.tests.test_io_formats.test_reference_list_input", + "eval.tests.test_io_formats.test_report_percentage_scales_id_to_100", + "eval.tests.test_io_formats.test_seed_seglength_drops_shorter_query_read", + "eval.tests.test_mapping_output.test_identity_tag_provided_for_multithread_maps[1]", + "eval.tests.test_mapping_output.test_identity_tag_provided_for_multithread_maps[2]", + "eval.tests.test_mapping_output.test_identity_tag_provided_for_multithread_maps[8]", + "eval.tests.test_mapping_output.test_mappings_reference_expected_contig", + "eval.tests.test_mapping_output.test_matched_lengths_do_not_exceed_reference", + "eval.tests.test_mapping_output.test_paf_coordinates_and_orientation_consistent", + "eval.tests.test_mapping_output.test_paf_rows_have_canonical_column_count", + "eval.tests.test_mapping_output.test_query_with_no_match_produces_no_row_for_that_query", + "eval.tests.test_mapping_output.test_short_reference_paired_reference_is_matched", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_filter_length_mismatches_deterministic", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_index_threshold_options_deterministic_valid_paf[opt0]", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_index_threshold_options_deterministic_valid_paf[opt1]", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_index_threshold_options_deterministic_valid_paf[opt2]", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_kmer_size_changes_index_and_mapping", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_lower_triangular_keeps_only_higher_query_index", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_nohgfilter_uses_first_pass_filtering", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_self_default_contains_self_rows_removed_ordered", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_sketch_size_changes_index_and_mapping", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_skipself_drops_equal_name_rows", + "eval.tests.test_pool_all_vs_all_and_sketch_options.test_skipself_rows_are_strict_subset_of_default", + "eval.tests.test_pool_options_and_validation.test_anidiff_out_of_range_rejected[-5]", + "eval.tests.test_pool_options_and_validation.test_anidiff_out_of_range_rejected[150]", + "eval.tests.test_pool_options_and_validation.test_block_length_zero_boundary_accepted", + "eval.tests.test_pool_options_and_validation.test_dense_sketching_completes_valid_paf", + "eval.tests.test_pool_options_and_validation.test_gzipped_query_maps_identically_to_plaintext", + "eval.tests.test_pool_options_and_validation.test_hgconf_out_of_range_rejected[-5]", + "eval.tests.test_pool_options_and_validation.test_hgconf_out_of_range_rejected[150]", + "eval.tests.test_pool_options_and_validation.test_legacy_uses_space_delimited_mashmap2_format", + "eval.tests.test_pool_options_and_validation.test_negative_block_length_rejected[-1-blocklength_error.txt]", + "eval.tests.test_pool_options_and_validation.test_negative_block_length_rejected[-5-blocklength_error.txt]", + "eval.tests.test_pool_options_and_validation.test_nsplit_disables_read_splitting", + "eval.tests.test_pool_options_and_validation.test_num_mappings_per_segment_two_deterministic", + "eval.tests.test_pool_options_and_validation.test_pi_exact_fifty_boundary_accepted", + "eval.tests.test_pool_options_and_validation.test_report_percentage_with_nomerge_emits_both_tags", + "eval.tests.test_pool_options_and_validation.test_sparsify_mappings_one_keeps_all", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipprefix_banner_and_absent_delimiter", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipprefix_drops_same_prefix_rows", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipprefix_uses_last_delimiter_occurrence", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_skipself_and_skipprefix_compose", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_sparsify_fractional_deterministic_across_threads", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_sparsify_fractional_drops_rows_monotonically", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_targetlist_restricts_to_named_targets", + "eval.tests.test_pool_skip_prefix_target_sparsify.test_targetprefix_restricts_indexed_targets", + "eval.tests.test_reference_index_io.test_loadindex_nonexistent_prefix_fails_without_mapping", + "eval.tests.test_reference_index_io.test_loadindex_output_deterministic_across_threads", + "eval.tests.test_reference_index_io.test_loadindex_reproduces_identical_mapping", + "eval.tests.test_reference_index_io.test_reference_list_map_uses_index_pool", + "eval.tests.test_reference_index_io.test_saveindex_creates_index_files", + "eval.tests.test_reference_index_io.test_saveindex_does_not_require_query_index_rebuild", + "eval.tests.test_thread_pool_determinism.test_every_row_sorted_by_query_order", + "eval.tests.test_thread_pool_determinism.test_large_thread_counts_terminate_and_match_single", + "eval.tests.test_thread_pool_determinism.test_many_tasks_over_many_workers_matches_single", + "eval.tests.test_thread_pool_determinism.test_many_tasks_per_worker_preserves_order", + "eval.tests.test_thread_pool_determinism.test_multithread_maps_same_contigs_as_single_thread", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[1-16]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[1-2]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[1-4]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[1-8]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[16-64]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[2-4]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[2-8]", + "eval.tests.test_thread_pool_determinism.test_output_identical_across_thread_counts[4-16]", + "eval.tests.test_thread_pool_determinism.test_reference_index_build_parallelizes", + "eval.tests.test_thread_pool_determinism.test_runs_terminate_and_emit_valid_paf_for_all_thread_counts", + "eval.tests.test_thread_pool_determinism.test_zero_or_non_numeric_threads_never_completes" + ] + }, + "generated_module_06": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_arg_parser.test_help_short_exits_one", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_arg_parser.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_arg_parser.test_double_dash_treated_as_argument", + "eval.tests.test_arg_parser.test_help_example_usage_line", + "eval.tests.test_arg_parser.test_help_lists_documented_options", + "eval.tests.test_arg_parser.test_help_long_option", + "eval.tests.test_arg_parser.test_help_short_exits_one", + "eval.tests.test_arg_parser.test_malformed_multiple_short_with_value", + "eval.tests.test_arg_parser.test_missing_value_at_end_of_argv", + "eval.tests.test_arg_parser.test_missing_value_long_option", + "eval.tests.test_arg_parser.test_missing_value_long_when_next_is_option", + "eval.tests.test_arg_parser.test_missing_value_when_next_is_option", + "eval.tests.test_arg_parser.test_option_after_argument", + "eval.tests.test_arg_parser.test_option_after_argument_long", + "eval.tests.test_arg_parser.test_required_option_missing", + "eval.tests.test_arg_parser.test_single_dash_is_argument", + "eval.tests.test_arg_parser.test_unknown_long_option", + "eval.tests.test_arg_parser.test_unknown_short_option", + "eval.tests.test_arg_parser.test_unknown_uppercase_version_not_defined", + "eval.tests.test_arg_parser.test_version_long_option", + "eval.tests.test_arg_parser.test_version_short_option", + "eval.tests.test_arg_parser.test_version_wins_over_ref_requirement", + "eval.tests.test_file_parsing.test_all_vs_all_when_query_omitted", + "eval.tests.test_file_parsing.test_default_output_file_is_mashmap_out", + "eval.tests.test_file_parsing.test_fastq_query_parsed", + "eval.tests.test_file_parsing.test_gzip_fasta_reference_parsed", + "eval.tests.test_file_parsing.test_mapping_output_lines_have_paf_shape", + "eval.tests.test_file_parsing.test_missing_query_list_file_rejected", + "eval.tests.test_file_parsing.test_missing_reference_list_file_rejected", + "eval.tests.test_file_parsing.test_output_filename_respected", + "eval.tests.test_file_parsing.test_plain_fasta_reference_and_query_map", + "eval.tests.test_file_parsing.test_query_list_file_parses", + "eval.tests.test_file_parsing.test_reference_list_file_parses_multiple_refs", + "eval.tests.test_gz_fastq_routes.test_gzip_fastq_query_maps", + "eval.tests.test_gz_fastq_routes.test_gzip_fastq_query_via_query_list", + "eval.tests.test_gz_fastq_routes.test_gzip_fastq_reference_accepted", + "eval.tests.test_list_and_gz_routes.test_blank_line_in_query_list_rejected", + "eval.tests.test_list_and_gz_routes.test_blank_line_in_reference_list_rejected", + "eval.tests.test_list_and_gz_routes.test_gzip_query_via_query_list", + "eval.tests.test_list_and_gz_routes.test_gzip_reference_via_reference_list", + "eval.tests.test_list_and_gz_routes.test_missing_middle_reference_list_entry_rejected", + "eval.tests.test_list_and_gz_routes.test_reference_list_with_trailing_whitespace_entry_rejected", + "eval.tests.test_more_module_edges.test_fastq_reference_accepted", + "eval.tests.test_more_module_edges.test_multi_record_fastq_query_accounting[two_long-[mashmap::skch::Map::mapQuery] count of mapped reads = 2, reads qualified for mapping = 2, total input reads = 2, total input bp = 40000]", + "eval.tests.test_more_module_edges.test_multi_record_fastq_query_accounting[with_short-[mashmap::skch::Map::mapQuery] count of mapped reads = 1, reads qualified for mapping = 2, total input reads = 2, total input bp = 20020]", + "eval.tests.test_more_module_edges.test_repeated_reference_option_last_wins", + "eval.tests.test_more_module_edges.test_trailing_positional_arguments_ignored", + "eval.tests.test_more_module_edges.test_user_sketch_size_echo_exact[spelling0]", + "eval.tests.test_more_module_edges.test_user_sketch_size_echo_exact[spelling1]", + "eval.tests.test_more_module_edges.test_user_sketch_size_echo_exact[spelling2]", + "eval.tests.test_more_parser_edges.test_long_help_with_inline_value_returns_help", + "eval.tests.test_more_parser_edges.test_long_value_option_multiple_equals_echoes_concat", + "eval.tests.test_more_parser_edges.test_short_help_with_inline_value_returns_help", + "eval.tests.test_more_parser_edges.test_short_value_option_multiple_equals_concatenate", + "eval.tests.test_more_parser_edges.test_triple_dash_even_known_option_treated_unknown", + "eval.tests.test_more_parser_edges.test_triple_dash_long_option_reports_stripped_name", + "eval.tests.test_more_parser_edges.test_version_short_circuits_later_unknown_option", + "eval.tests.test_more_parser_edges.test_version_short_circuits_later_unknown_short", + "eval.tests.test_more_parser_edges.test_version_with_inline_value_still_prints_version", + "eval.tests.test_parameters.test_argument_before_option_is_misplaced", + "eval.tests.test_parameters.test_block_length_at_default_gives_no_filter_echo", + "eval.tests.test_parameters.test_block_length_greater_than_segment_activates_filter", + "eval.tests.test_parameters.test_chain_gap_echoed", + "eval.tests.test_parameters.test_dense_flag_computes_dense_sketch_size", + "eval.tests.test_parameters.test_flag_only_options_accepted[--dense]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--dropLowMapId]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--filterLengthMismatches]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--legacy]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--lowerTriangular]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--noHgFilter]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--noMerge]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--noSplit]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--reportPercentage]", + "eval.tests.test_parameters.test_flag_only_options_accepted[--skipSelf]", + "eval.tests.test_parameters.test_flag_only_options_accepted[-K]", + "eval.tests.test_parameters.test_flag_only_options_accepted[-M]", + "eval.tests.test_parameters.test_flag_only_options_accepted[-X]", + "eval.tests.test_parameters.test_kmer_complexity_threshold_echoed", + "eval.tests.test_parameters.test_multiple_value_options_combine", + "eval.tests.test_parameters.test_no_split_disables_read_splitting", + "eval.tests.test_parameters.test_num_mappings_per_segment_echoed", + "eval.tests.test_parameters.test_skip_prefix_echoed", + "eval.tests.test_parameters.test_skip_self_flag_echoed", + "eval.tests.test_parameters.test_sparsify_mappings_flag_accepted", + "eval.tests.test_seqiter_gzip_parsing.test_fasta_header_description_stripped_in_query_name", + "eval.tests.test_seqiter_gzip_parsing.test_fasta_header_description_stripped_in_target_name", + "eval.tests.test_seqiter_gzip_parsing.test_filter_mode_none_disables_hypergeometric_filter", + "eval.tests.test_seqiter_gzip_parsing.test_filter_mode_one_to_one_echo", + "eval.tests.test_seqiter_gzip_parsing.test_gzip_both_orientations_exact_accounting", + "eval.tests.test_seqiter_gzip_parsing.test_gzip_query_read_path_reads_full_sequence", + "eval.tests.test_seqiter_gzip_parsing.test_gzip_reference_read_path_reads_full_sequence", + "eval.tests.test_seqiter_gzip_parsing.test_hg_filter_ani_diff_in_range_echo", + "eval.tests.test_seqiter_gzip_parsing.test_kmer_threshold_option_value_parsed", + "eval.tests.test_seqiter_gzip_parsing.test_lower_triangular_flag_accepted", + "eval.tests.test_seqiter_gzip_parsing.test_unknown_format_query_rejected", + "eval.tests.test_seqiter_gzip_parsing.test_unknown_format_reference_rejected", + "eval.tests.test_sequence_variants.test_gzip_fasta_query_parsed", + "eval.tests.test_sequence_variants.test_gzip_reference_and_query_combined", + "eval.tests.test_sequence_variants.test_legacy_output_format_space_delimited", + "eval.tests.test_sequence_variants.test_multi_record_fasta_lowercase_parsed", + "eval.tests.test_sequence_variants.test_no_hg_filter_disables_hypergeometric_filter", + "eval.tests.test_sequence_variants.test_report_percentage_ani_in_0_to_100", + "eval.tests.test_sequence_variants.test_save_index_writes_map_and_index_files", + "eval.tests.test_sequence_variants.test_short_query_below_segment_length_ignored", + "eval.tests.test_validation.test_block_length_negative_rejected", + "eval.tests.test_validation.test_chain_gap_negative_rejected", + "eval.tests.test_validation.test_combined_short_option_parses_flags", + "eval.tests.test_validation.test_combined_short_with_unknown_character", + "eval.tests.test_validation.test_digit_first_token_is_value_not_option", + "eval.tests.test_validation.test_filter_mode_invalid_rejected", + "eval.tests.test_validation.test_filter_mode_valid_modes_accepted[map-[mashmap] Filter mode = 1 (1 = map, 2 = one-to-one, 3 = none)]", + "eval.tests.test_validation.test_filter_mode_valid_modes_accepted[none-[mashmap] Filter mode = 3 (1 = map, 2 = one-to-one, 3 = none)]", + "eval.tests.test_validation.test_filter_mode_valid_modes_accepted[one-to-one-[mashmap] Filter mode = 2 (1 = map, 2 = one-to-one, 3 = none)]", + "eval.tests.test_validation.test_hg_filter_ani_diff_out_of_range[-10]", + "eval.tests.test_validation.test_hg_filter_ani_diff_out_of_range[150]", + "eval.tests.test_validation.test_hg_filter_conf_out_of_range[-1]", + "eval.tests.test_validation.test_hg_filter_conf_out_of_range[200]", + "eval.tests.test_validation.test_missing_query_file_validated", + "eval.tests.test_validation.test_missing_reference_file_validated", + "eval.tests.test_validation.test_num_mappings_for_segment_zero_rejected", + "eval.tests.test_validation.test_num_mappings_short_seq_nonpositive_rejected", + "eval.tests.test_validation.test_numeric_negative_accepted_as_value", + "eval.tests.test_validation.test_option_value_assignment_with_empty_value_unknown", + "eval.tests.test_validation.test_option_value_required_but_omitted[bad_form0]", + "eval.tests.test_validation.test_option_value_required_but_omitted[bad_form1]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair0]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair1]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair2]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair3]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair4]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair5]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair6]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair7]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair8]", + "eval.tests.test_validation.test_option_value_spellings_are_accepted[option_pair9]", + "eval.tests.test_validation.test_perc_identity_below_threshold_rejected[-5]", + "eval.tests.test_validation.test_perc_identity_below_threshold_rejected[0]", + "eval.tests.test_validation.test_perc_identity_below_threshold_rejected[30]", + "eval.tests.test_validation.test_perc_identity_threshold_value_accepted", + "eval.tests.test_validation.test_seg_length_at_minimum_is_accepted", + "eval.tests.test_validation.test_seg_length_below_minimum_rejected", + "eval.tests.test_validation.test_seg_length_hundred_boundary_rejected" + ] + } + }, + "commit": "1a07d0ea4e2c7c4a97fc92cbc29abc05e8cba7eb", + "data_source": "synthetic_programgym", + "difficulty": "medium", + "difficulty_score": 2.870029150013057, + "eval_clean_hashes": [ + "b2c37ff087ddb2ab4e9cd2115dca694b48edefdc08a36568ebb6ffadd147a22c" + ], + "input_record": { + "commit": "1a07d0ea4e2c7c4a97fc92cbc29abc05e8cba7eb", + "difficulty": "medium", + "difficulty_code_lines": 24712, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 24712, + "difficulty_runtime_deps": 2, + "difficulty_score": 2.870029150013057, + "difficulty_test_code_lines": 0, + "full_name": "marbl/MashMap", + "input_joern_zip": "cpp_joern/marbl__MashMap.zip", + "joern_status": true, + "joern_time": 20.601580265909433, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 252, + "similarity": 0.5022381544113159 + } + ], + "repo_path": "cpp/marbl__MashMap", + "source": "commit:1a07d0ea4e2c7c4a97fc92cbc29abc05e8cba7eb", + "status": "done", + "url": "https://github.com/marbl/MashMap" + }, + "instance_id": "marbl__MashMap.1a07d0e", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 10, + "branch_name": "generated_module_01", + "iteration_limit": 10, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 6, + "branch_name": "generated_module_02", + "iteration_limit": 10, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 6, + "branch_name": "generated_module_03", + "iteration_limit": 10, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 9, + "branch_name": "generated_module_04", + "iteration_limit": 10, + "module_index": 4, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_05", + "iteration_limit": 10, + "module_index": 5, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_06", + "iteration_limit": 10, + "module_index": 6, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "marbl/MashMap" +} diff --git a/marbl--mashmap.1a07d0e/tests/test.sh b/marbl--mashmap.1a07d0e/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/marbl--mashmap.1a07d0e/tests/workspace.tar.gz b/marbl--mashmap.1a07d0e/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6726ec27d13a340ece69de952ce3266355a2d063 --- /dev/null +++ b/marbl--mashmap.1a07d0e/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cea623b097b3930b337ad7a7af23a1bba97816c0f0312feea888b8898ada487 +size 17301 diff --git a/marco-calautti--deltapatcher.498/environment/Dockerfile b/marco-calautti--deltapatcher.498/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/marco-calautti--deltapatcher.498/environment/docker-compose.yaml b/marco-calautti--deltapatcher.498/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/marco-calautti--deltapatcher.498/environment/download.sh b/marco-calautti--deltapatcher.498/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..184efc3483baa5be718f68b6648db438ffe2a1ea --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/download.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# +# ProgramGym download stage for DeltaPatcher (marco-calautti/DeltaPatcher). +# +# This script is STANDALONE: it runs in a networked container where only +# download.sh itself is guaranteed to be present (/source_ro/download.sh). It +# must not read any repository file. It provisions the system build dependency +# (GTK3 development stack for the wxWidgets GUI) and prefetches the three git +# submodule sources referenced by the repository's .gitmodules +# (libs/wxWidgets, libs/xdelta, libs/xz) at their exact pinned commits into a +# persistent cache at /opt/ProgramGym/deps. The offline build.sh later copies +# those sources into the empty libs/ subdirectories and builds. +# +# Source-safe: `source /source_ro/download.sh` keeps exported variables in the +# current shell and never calls exit in normal control flow. + +set -u + +# Persistent dependency cache shared with the offline build stage. +export DP_DEPS_DIR="/opt/ProgramGym/deps" +export DP_DEPS_READY=0 + +# --- 1. System build dependency (GTK3 dev) -------------------------------- +# wxWidgets' GTK port needs the GTK3 development stack. The base image does not +# ship it, so install it here (download stage only). Idempotent: skip when the +# package is already present (dpkg -s exits 0). +if dpkg -s libgtk-3-dev; then + echo "[download] libgtk-3-dev already present" +else + echo "[download] running apt-get update" + apt-get update + echo "[download] installing libgtk-3-dev" + DEBIAN_FRONTEND=noninteractive apt-get install -y libgtk-3-dev + echo "[download] libgtk-3-dev installed" +fi + +# --- 2. Prefetch the three git submodules at the exact pinned commits ------ +# The submodule directories in the repository are empty (gitlinks recorded in +# the index but working trees not checked out). Their content is fetched here +# into the persistent cache so build.sh can populate the libs/ tree offline. +# URLs and pinned SHAs are derived from the repository's .gitmodules and git +# index and written explicitly here because download.sh cannot read repository +# files. +mkdir -p "${DP_DEPS_DIR}" + +fetch_submodule() { + local name="$1" + local url="$2" + local sha="$3" + local dest="${DP_DEPS_DIR}/${name}" + + if [ -d "${dest}/.git" ]; then + local cur + if cur="$(git -C "${dest}" rev-parse HEAD)"; then + if [ "${cur}" = "${sha}" ]; then + echo "[download] ${name} already fetched at ${sha}" + return 0 + fi + echo "[download] ${name} present but at wrong commit; refetching" + else + echo "[download] ${name} present but unreadable; refetching" + fi + rm -rf "${dest}" + fi + + git init -q "${dest}" + git -C "${dest}" remote add origin "${url}" + git -C "${dest}" fetch --depth 1 origin "${sha}" + git -C "${dest}" checkout -q "${sha}" + + if [ "$(git -C "${dest}" rev-parse HEAD)" = "${sha}" ]; then + echo "[download] ${name} fetched at ${sha}" + else + echo "[download] ERROR: ${name} did not checkout requested commit" + return 1 + fi +} + +fetch_submodule wxWidgets \ + "https://github.com/wxWidgets/wxWidgets.git" \ + "49c6810948f40c457e3d0848b9111627b5b61de5" +wx_rc=$? + +fetch_submodule xdelta \ + "https://github.com/marco-calautti/xdelta.git" \ + "ab959ecd9a471a0dec5babc3de9d1e27ca25ffa8" +xd_rc=$? + +fetch_submodule xz \ + "https://github.com/tukaani-project/xz.git" \ + "a522a226545730551f7e7c2685fab27cf567746c" +xz_rc=$? + +if [ "${wx_rc}" -eq 0 ] && [ "${xd_rc}" -eq 0 ] && [ "${xz_rc}" -eq 0 ]; then + export DP_DEPS_READY=1 + echo "[download] dependency cache ready at ${DP_DEPS_DIR}" +else + echo "[download] ERROR: one or more submodules failed to fetch" + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/marco-calautti--deltapatcher.498/environment/executable b/marco-calautti--deltapatcher.498/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..bcb90fe795cbb6c47a7ba37d9a9bc103469a1cb0 --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a50c18258ae79d7bae28932247aa1832559a9b2ef9c59dcb26be7d31b18d932 +size 12434472 diff --git a/marco-calautti--deltapatcher.498/environment/harbor_configure_apt_mirror.sh b/marco-calautti--deltapatcher.498/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/marco-calautti--deltapatcher.498/environment/harbor_prepare_download_env.sh b/marco-calautti--deltapatcher.498/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marco-calautti--deltapatcher.498/environment/workspace.tar.gz b/marco-calautti--deltapatcher.498/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..75cea828f2135da7bdb61b486f950bea45cffd88 --- /dev/null +++ b/marco-calautti--deltapatcher.498/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8090bdf237ea5e9e2ee9e8d88e4ee506e34182d76aa069414d1d953242a8eb +size 9980 diff --git a/marco-calautti--deltapatcher.498/instruction.md b/marco-calautti--deltapatcher.498/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/marco-calautti--deltapatcher.498/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/marco-calautti--deltapatcher.498/solution/solve.sh b/marco-calautti--deltapatcher.498/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/marco-calautti--deltapatcher.498/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/marco-calautti--deltapatcher.498/task.toml b/marco-calautti--deltapatcher.498/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..08c5701a6960eb012f7d3150b10013b15d74166c --- /dev/null +++ b/marco-calautti--deltapatcher.498/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/marco-calautti--deltapatcher.498" +description = "Synthetic ProgramGym cleanroom reconstruction task for marco-calautti/DeltaPatcher" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "marco-calautti__DeltaPatcher.498378c" +repository = "marco-calautti/DeltaPatcher" +commit = "498378cfd3c4a472dfd40d6cc0588f53df8cf1ca" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.5121505369220305 +test_branches = 4 +test_count = 137 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/marco-calautti--deltapatcher.498/tests/Dockerfile b/marco-calautti--deltapatcher.498/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_01.tar.gz b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..da3e4a8d509eec37b6d80966158e7cc3b03ae760 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e10ad50f50a60e1e2bf23d29c188348106820b9c85cd6580bb57ac7408c125b4 +size 22829 diff --git a/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_02.tar.gz b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a78eb6c7b761e0ef0c94c90c9918ae01f52a1cee --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aef40df0e941b6ac225d5de0ea623243576856f48dd04445809381334cf80675 +size 7809 diff --git a/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_03.tar.gz b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a7ddebde7dc4ffd259422ee78bf45791c3a39137 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:018a6500ec4f20bb39da4270f266e7dd08aa8e62bf98e3ec2bce920b01005ee4 +size 13274 diff --git a/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_04.tar.gz b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e1f7b4044dcb6ff25e55323866ca8f59c3078ef --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01f2330e83f0a568f51c533f8b551110c03b418da678155431b098372924a8b9 +size 7514 diff --git a/marco-calautti--deltapatcher.498/tests/docker-compose.yaml b/marco-calautti--deltapatcher.498/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/marco-calautti--deltapatcher.498/tests/download.sh b/marco-calautti--deltapatcher.498/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..184efc3483baa5be718f68b6648db438ffe2a1ea --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/download.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +# +# ProgramGym download stage for DeltaPatcher (marco-calautti/DeltaPatcher). +# +# This script is STANDALONE: it runs in a networked container where only +# download.sh itself is guaranteed to be present (/source_ro/download.sh). It +# must not read any repository file. It provisions the system build dependency +# (GTK3 development stack for the wxWidgets GUI) and prefetches the three git +# submodule sources referenced by the repository's .gitmodules +# (libs/wxWidgets, libs/xdelta, libs/xz) at their exact pinned commits into a +# persistent cache at /opt/ProgramGym/deps. The offline build.sh later copies +# those sources into the empty libs/ subdirectories and builds. +# +# Source-safe: `source /source_ro/download.sh` keeps exported variables in the +# current shell and never calls exit in normal control flow. + +set -u + +# Persistent dependency cache shared with the offline build stage. +export DP_DEPS_DIR="/opt/ProgramGym/deps" +export DP_DEPS_READY=0 + +# --- 1. System build dependency (GTK3 dev) -------------------------------- +# wxWidgets' GTK port needs the GTK3 development stack. The base image does not +# ship it, so install it here (download stage only). Idempotent: skip when the +# package is already present (dpkg -s exits 0). +if dpkg -s libgtk-3-dev; then + echo "[download] libgtk-3-dev already present" +else + echo "[download] running apt-get update" + apt-get update + echo "[download] installing libgtk-3-dev" + DEBIAN_FRONTEND=noninteractive apt-get install -y libgtk-3-dev + echo "[download] libgtk-3-dev installed" +fi + +# --- 2. Prefetch the three git submodules at the exact pinned commits ------ +# The submodule directories in the repository are empty (gitlinks recorded in +# the index but working trees not checked out). Their content is fetched here +# into the persistent cache so build.sh can populate the libs/ tree offline. +# URLs and pinned SHAs are derived from the repository's .gitmodules and git +# index and written explicitly here because download.sh cannot read repository +# files. +mkdir -p "${DP_DEPS_DIR}" + +fetch_submodule() { + local name="$1" + local url="$2" + local sha="$3" + local dest="${DP_DEPS_DIR}/${name}" + + if [ -d "${dest}/.git" ]; then + local cur + if cur="$(git -C "${dest}" rev-parse HEAD)"; then + if [ "${cur}" = "${sha}" ]; then + echo "[download] ${name} already fetched at ${sha}" + return 0 + fi + echo "[download] ${name} present but at wrong commit; refetching" + else + echo "[download] ${name} present but unreadable; refetching" + fi + rm -rf "${dest}" + fi + + git init -q "${dest}" + git -C "${dest}" remote add origin "${url}" + git -C "${dest}" fetch --depth 1 origin "${sha}" + git -C "${dest}" checkout -q "${sha}" + + if [ "$(git -C "${dest}" rev-parse HEAD)" = "${sha}" ]; then + echo "[download] ${name} fetched at ${sha}" + else + echo "[download] ERROR: ${name} did not checkout requested commit" + return 1 + fi +} + +fetch_submodule wxWidgets \ + "https://github.com/wxWidgets/wxWidgets.git" \ + "49c6810948f40c457e3d0848b9111627b5b61de5" +wx_rc=$? + +fetch_submodule xdelta \ + "https://github.com/marco-calautti/xdelta.git" \ + "ab959ecd9a471a0dec5babc3de9d1e27ca25ffa8" +xd_rc=$? + +fetch_submodule xz \ + "https://github.com/tukaani-project/xz.git" \ + "a522a226545730551f7e7c2685fab27cf567746c" +xz_rc=$? + +if [ "${wx_rc}" -eq 0 ] && [ "${xd_rc}" -eq 0 ] && [ "${xz_rc}" -eq 0 ]; then + export DP_DEPS_READY=1 + echo "[download] dependency cache ready at ${DP_DEPS_DIR}" +else + echo "[download] ERROR: one or more submodules failed to fetch" + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/marco-calautti--deltapatcher.498/tests/executable b/marco-calautti--deltapatcher.498/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..bcb90fe795cbb6c47a7ba37d9a9bc103469a1cb0 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a50c18258ae79d7bae28932247aa1832559a9b2ef9c59dcb26be7d31b18d932 +size 12434472 diff --git a/marco-calautti--deltapatcher.498/tests/harbor_configure_apt_mirror.sh b/marco-calautti--deltapatcher.498/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/marco-calautti--deltapatcher.498/tests/harbor_prepare_download_env.sh b/marco-calautti--deltapatcher.498/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marco-calautti--deltapatcher.498/tests/programgym_evaluator.py b/marco-calautti--deltapatcher.498/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/marco-calautti--deltapatcher.498/tests/programgym_task.json b/marco-calautti--deltapatcher.498/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..646d24866a2eeaf61f503517ac21179153a97c13 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/programgym_task.json @@ -0,0 +1,284 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_deltapatcher_blackbox.test_executable_is_the_wxgtk_deltapatcher_binary", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_deltapatcher_blackbox.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_deltapatcher_blackbox.test_evaluated_executable_is_a_real_elf_binary", + "eval.tests.test_deltapatcher_blackbox.test_executable_is_the_wxgtk_deltapatcher_binary", + "eval.tests.test_deltapatcher_blackbox.test_exit_status_is_gtk_init_failure", + "eval.tests.test_deltapatcher_blackbox.test_explicit_dummy_display_address_still_yields_headless_failure", + "eval.tests.test_deltapatcher_blackbox.test_headless_failure_is_deterministic_across_repeated_runs", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[decode-flag]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[encode-flag]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[force-flag]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[help-long]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[help-short]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[source-flag-args]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[version-long]", + "eval.tests.test_deltapatcher_blackbox.test_no_cli_patch_or_help_surface_exists[version-short]", + "eval.tests.test_deltapatcher_blackbox.test_no_output_is_written_to_stdout", + "eval.tests.test_deltapatcher_blackbox.test_positional_xdelta_argument_does_not_bypass_display_requirement", + "eval.tests.test_deltapatcher_blackbox.test_stderr_carries_semantic_gtk_diagnostic" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cmdline_diagnostics.test_mixed_option_and_positional[long_then_extra-argv0-mixed_long_then_extra]", + "eval.tests.test_cmdline_diagnostics.test_mixed_option_and_positional[short_then_xdelta-argv1-mixed_short_then_xdelta]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[many-argv3-unexpected_pos2_two]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[second_upper-argv5-unexpected_pos2_B]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[three-argv2-unexpected_pos2_b3]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[two_plain-argv1-unexpected_pos2_b]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[two_with_dot-argv4-unexpected_pos2_dat]", + "eval.tests.test_cmdline_diagnostics.test_unexpected_positional[two_xdelta-argv0-unexpected_pos2_xdelta]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[bogus-argv0-unknown_long_bogus]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[dashed_long-argv6-unknown_long_delta]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[equals-argv1-unknown_long_foo_equal]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[help-argv3-unknown_long_help]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[single_dash_bogus-argv5-unknown_short_bogus]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[underscore_long-argv7-unknown_long_patch_name]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[version-argv4-unknown_long_version]", + "eval.tests.test_cmdline_diagnostics.test_unknown_long_option[very_long-argv2-unknown_long_very_long]", + "eval.tests.test_cmdline_diagnostics.test_unknown_short_option[combined-argv2-unknown_short_ab]", + "eval.tests.test_cmdline_diagnostics.test_unknown_short_option[single_a-argv3-unknown_short_a]", + "eval.tests.test_cmdline_diagnostics.test_unknown_short_option[triple-argv4-unknown_short_xyz]", + "eval.tests.test_cmdline_diagnostics.test_unknown_short_option[x-argv0-unknown_short_x]", + "eval.tests.test_cmdline_diagnostics.test_unknown_short_option[z9-argv1-unknown_short_z9]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv0-missing_xdelta]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv1-missing_nested_xdelta]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv2-uppercase_ext]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv3-mixed_case_ext]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv4-no_extension]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv5-plain_text_ext]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv6-empty_argument]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv7-end_of_options_then_xdelta]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv8-end_of_options_only]", + "eval.tests.test_startup_headless.test_patch_argument_startup_rejection[argv9-single_dash]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_blackbox_cli.test_patch_path_extension_edge_shapes_keep_boundary", + "reasons": [ + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_blackbox_cli.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_blackbox_cli.test_concurrent_invocations_are_independently_deterministic", + "eval.tests.test_blackbox_cli.test_contract_is_invariant_to_the_working_directory", + "eval.tests.test_blackbox_cli.test_diagnostic_is_independent_of_locale_environment", + "eval.tests.test_blackbox_cli.test_executable_elf_program_header_table_is_stable", + "eval.tests.test_blackbox_cli.test_executable_is_a_64bit_little_endian_elf", + "eval.tests.test_blackbox_cli.test_executable_is_a_dynamic_x86_64_elf_with_standard_loader", + "eval.tests.test_blackbox_cli.test_executable_is_a_non_empty_real_elf_executable", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[dash-V]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[dash-dash-token]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[dash-v]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[dashdash-sentinel]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[equals-style-option]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[leading-equals]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[long-help]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[short-help]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[single-dash]", + "eval.tests.test_blackbox_cli.test_flag_and_option_argument_shapes_reach_exact_failure_boundary[version-token]", + "eval.tests.test_blackbox_cli.test_golden_literal_shipped_file_and_executable_agree", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[dbus-address]", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[gtk-theme]", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[qt-style]", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[wayland-display]", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[xauthority-none]", + "eval.tests.test_blackbox_cli.test_gtk_wayland_dbus_environment_residue_keeps_boundary[xdg-session-type]", + "eval.tests.test_blackbox_cli.test_help_flags_do_not_emit_wxwidgets_help_or_usage_banner", + "eval.tests.test_blackbox_cli.test_home_and_xdg_config_env_do_not_change_headless_boundary", + "eval.tests.test_blackbox_cli.test_long_argument_vector_of_independent_tokens_is_accepted", + "eval.tests.test_blackbox_cli.test_misc_single_argument_shapes_reach_exact_failure_boundary[double-dot]", + "eval.tests.test_blackbox_cli.test_misc_single_argument_shapes_reach_exact_failure_boundary[empty-string-parameter]", + "eval.tests.test_blackbox_cli.test_misc_single_argument_shapes_reach_exact_failure_boundary[long-single-parameter]", + "eval.tests.test_blackbox_cli.test_misc_single_argument_shapes_reach_exact_failure_boundary[non-patch-parameter]", + "eval.tests.test_blackbox_cli.test_misc_single_argument_shapes_reach_exact_failure_boundary[single-dot]", + "eval.tests.test_blackbox_cli.test_multi_positional_arguments_do_not_abort_parse_with_oracle_counts", + "eval.tests.test_blackbox_cli.test_multiple_xdelta_positionals_are_tolerated", + "eval.tests.test_blackbox_cli.test_no_argument_invocation_exits_with_wx_failure_return_code", + "eval.tests.test_blackbox_cli.test_no_argument_stderr_exactly_matches_normalized_golden", + "eval.tests.test_blackbox_cli.test_no_argument_stdout_is_empty", + "eval.tests.test_blackbox_cli.test_oversized_single_argument_is_tolerated_without_truncation", + "eval.tests.test_blackbox_cli.test_patch_path_extension_edge_shapes_keep_boundary", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[absolute-patch-path]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[bare-patch-extension]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[dotted-basename]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[non-ascii-name]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[relative-patch-path]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[spaces-in-name]", + "eval.tests.test_blackbox_cli.test_patch_xdelta_argument_classes_reach_exact_failure_boundary[uppercase-extension]", + "eval.tests.test_blackbox_cli.test_recognized_patch_argument_combined_with_option_tokens_keeps_boundary", + "eval.tests.test_blackbox_cli.test_startup_boundary_is_invariant_to_program_name", + "eval.tests.test_blackbox_cli.test_stderr_is_a_single_timestamped_diagnostic_line", + "eval.tests.test_blackbox_cli.test_stderr_trace_has_no_stray_trailing_or_embedded_residue", + "eval.tests.test_blackbox_cli.test_stdin_presence_and_absence_do_not_alter_contract", + "eval.tests.test_blackbox_cli.test_two_consecutive_invocations_are_deterministic", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[colonsingle]", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[empty-string]", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[garbage]", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[high-number]", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[hostname-style]", + "eval.tests.test_blackbox_cli.test_unreachable_display_values_keep_identical_failure_boundary[screen-suffix]", + "eval.tests.test_blackbox_cli.test_xdelta_extension_match_is_case_insensitive_for_decode_route", + "eval.tests.test_blackbox_cli.test_xdelta_parameter_with_display_environment_keeps_boundary[high-number]", + "eval.tests.test_blackbox_cli.test_xdelta_parameter_with_display_environment_keeps_boundary[lower-display]", + "eval.tests.test_blackbox_cli.test_xdelta_parameter_with_display_environment_keeps_boundary[screen-suffix]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_headless_runtime.test_branch_resource_text_argument", + "eval.tests.test_headless_runtime.test_branch_resource_xdelta_argument", + "eval.tests.test_headless_runtime.test_combined_flag_forms_headless_failure", + "eval.tests.test_headless_runtime.test_double_dash_separator_headless_failure", + "eval.tests.test_headless_runtime.test_empty_stdin_is_ignored", + "eval.tests.test_headless_runtime.test_exact_normalized_stderr_oracle", + "eval.tests.test_headless_runtime.test_executable_is_an_elf_binary", + "eval.tests.test_headless_runtime.test_exit_code_is_never_zero_headless", + "eval.tests.test_headless_runtime.test_gui_module_is_headless_unreachable_documented", + "eval.tests.test_headless_runtime.test_help_flag_dash_h_headless_failure", + "eval.tests.test_headless_runtime.test_help_flag_double_dash_headless_failure", + "eval.tests.test_headless_runtime.test_help_flag_question_mark_headless_failure", + "eval.tests.test_headless_runtime.test_many_positional_arguments_headless_failure", + "eval.tests.test_headless_runtime.test_missing_file_argument_headless_failure", + "eval.tests.test_headless_runtime.test_multiple_positional_arguments_headless_failure", + "eval.tests.test_headless_runtime.test_no_arguments_headless_failure", + "eval.tests.test_headless_runtime.test_no_patch_engine_driven_without_display", + "eval.tests.test_headless_runtime.test_non_xdelta_file_argument_headless_failure", + "eval.tests.test_headless_runtime.test_nonempty_stdin_batch_is_ignored", + "eval.tests.test_headless_runtime.test_patch_file_does_not_get_created", + "eval.tests.test_headless_runtime.test_path_with_spaces_argument_headless_failure", + "eval.tests.test_headless_runtime.test_programgym_executable_is_exported_and_runs", + "eval.tests.test_headless_runtime.test_single_dash_token_headless_failure", + "eval.tests.test_headless_runtime.test_stderr_carries_distinctive_diagnostic_and_exit_is_255", + "eval.tests.test_headless_runtime.test_stdout_is_empty_for_every_argument_family", + "eval.tests.test_headless_runtime.test_unknown_flag_headless_failure", + "eval.tests.test_headless_runtime.test_uppercase_xdelta_extension_headless_failure", + "eval.tests.test_headless_runtime.test_version_flag_long_headless_failure", + "eval.tests.test_headless_runtime.test_version_flag_short_headless_failure", + "eval.tests.test_headless_runtime.test_xdelta_patch_file_argument_headless_failure" + ] + } + }, + "commit": "498378cfd3c4a472dfd40d6cc0588f53df8cf1ca", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5121505369220305, + "eval_clean_hashes": [ + "4a50c18258ae79d7bae28932247aa1832559a9b2ef9c59dcb26be7d31b18d932" + ], + "input_record": { + "commit": "498378cfd3c4a472dfd40d6cc0588f53df8cf1ca", + "difficulty": "easy", + "difficulty_code_lines": 3252, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 3252, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.5121505369220305, + "difficulty_test_code_lines": 0, + "full_name": "marco-calautti/DeltaPatcher", + "input_joern_zip": "cpp_joern/marco-calautti__DeltaPatcher.zip", + "joern_status": true, + "joern_time": 6.508657523896545, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "ip7z/7zip", + "rank": 249, + "similarity": 0.4260789453983307 + }, + { + "pb_fullname": "ninja-build/ninja", + "rank": 102, + "similarity": 0.4932868480682373 + }, + { + "pb_fullname": "tstack/lnav", + "rank": 572, + "similarity": 0.44165343046188354 + }, + { + "pb_fullname": "NikolaDucak/caps-log", + "rank": 968, + "similarity": 0.3801552653312683 + } + ], + "repo_path": "cpp/marco-calautti__DeltaPatcher", + "source": "commit:498378cfd3c4a472dfd40d6cc0588f53df8cf1ca", + "status": "done", + "url": "https://github.com/marco-calautti/DeltaPatcher" + }, + "instance_id": "marco-calautti__DeltaPatcher.498378c", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "marco-calautti/DeltaPatcher" +} diff --git a/marco-calautti--deltapatcher.498/tests/test.sh b/marco-calautti--deltapatcher.498/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/marco-calautti--deltapatcher.498/tests/workspace.tar.gz b/marco-calautti--deltapatcher.498/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..75cea828f2135da7bdb61b486f950bea45cffd88 --- /dev/null +++ b/marco-calautti--deltapatcher.498/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d8090bdf237ea5e9e2ee9e8d88e4ee506e34182d76aa069414d1d953242a8eb +size 9980 diff --git a/marco-lancini--goscan.17b0823/environment/Dockerfile b/marco-lancini--goscan.17b0823/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/marco-lancini--goscan.17b0823/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/marco-lancini--goscan.17b0823/environment/download.sh b/marco-lancini--goscan.17b0823/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..ef9cf369da6426a2ffe9929a30e85024caba1703 --- /dev/null +++ b/marco-lancini--goscan.17b0823/environment/download.sh @@ -0,0 +1,203 @@ +#!/usr/bin/env bash +# Manually recovered and independently validated ProgramGym build contract. +set -euo pipefail +mkdir -p /workspace/.programgym_build_env/go-prefetch +export GOTOOLCHAIN=auto +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF' +module github.com/marco-lancini/goscan + +go 1.20 + +require ( + github.com/c-bata/go-prompt v0.2.6 + github.com/fatih/color v1.7.0 + github.com/jinzhu/gorm v1.9.11 + github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523 + github.com/olekukonko/tablewriter v0.0.4 +) + +require ( + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/mattn/go-colorable v0.1.7 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-sqlite3 v1.11.0 // indirect + github.com/mattn/go-tty v0.0.3 // indirect + github.com/pkg/term v1.2.0-beta.2 // indirect + golang.org/x/sys v0.0.0-20200918174421-af09f7315aff // indirect +) +PB_MANUAL_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PB_MANUAL_GO_SUM_EOF' +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU= +cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/c-bata/go-prompt v0.2.6 h1:POP+nrHE+DfLYx370bedwNhsqmpCUynWPxuHi0C5vZI= +github.com/c-bata/go-prompt v0.2.6/go.mod h1:/LMAke8wD2FsNu9EXNdHxNLbd9MedkPnCdfpU9wwHfY= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA= +github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jinzhu/gorm v1.9.11 h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE= +github.com/jinzhu/gorm v1.9.11/go.mod h1:bu/pK8szGZ2puuErfU0RwyeNdsf3e6nCX/noXaVxkfw= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523 h1:N4NQR4on0n3Kc3xlBXUYzCZorFdordwkR2kcZMk9te0= +github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523/go.mod h1:7Em1Lxm3DFdLvXWUZ6bQ/xIbGlxFy7jl07bziQMZ/kU= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= +github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw= +github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +PB_MANUAL_GO_SUM_EOF +cd /workspace/.programgym_build_env/go-prefetch +PB_RECOVERY_GOROOT="$(go env GOROOT)" +mkdir -p /opt/programgym-go-toolchain +cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/ +export GOROOT=/opt/programgym-go-toolchain +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all diff --git a/marco-lancini--goscan.17b0823/environment/executable b/marco-lancini--goscan.17b0823/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..68ab91236bce7b278718a5be12b597bb6e59c66d --- /dev/null +++ b/marco-lancini--goscan.17b0823/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4d94963ac62bf14f4850f54c9f1e2cddb2b68fce9831c4913876c2155ef507b +size 12392480 diff --git a/marco-lancini--goscan.17b0823/environment/programgym-go.tar.gz b/marco-lancini--goscan.17b0823/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/marco-lancini--goscan.17b0823/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/marco-lancini--goscan.17b0823/environment/workspace.tar.gz b/marco-lancini--goscan.17b0823/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7420f502929d5acefe4abbed6792fa08ae6d070f --- /dev/null +++ b/marco-lancini--goscan.17b0823/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8df11ff43048bf1777e582607647e2097402244b7dd88b6b31dbc240c3b011c +size 2729 diff --git a/marco-lancini--goscan.17b0823/instruction.md b/marco-lancini--goscan.17b0823/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/marco-lancini--goscan.17b0823/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/marco-lancini--goscan.17b0823/solution/solve.sh b/marco-lancini--goscan.17b0823/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/marco-lancini--goscan.17b0823/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/marco-lancini--goscan.17b0823/task.toml b/marco-lancini--goscan.17b0823/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e74e5f2a9f7b649473aa8d6b65b3d824a1af8908 --- /dev/null +++ b/marco-lancini--goscan.17b0823/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/marco-lancini--goscan.17b0823" +description = "Synthetic ProgramGym cleanroom reconstruction task for marco-lancini/goscan" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "marco-lancini__goscan.17b0823" +repository = "marco-lancini/goscan" +commit = "17b08232200e6d34b8f71cd7f235e0923ae79e1a" +language = "go" +difficulty = "easy" +difficulty_score = 1.4763968267253302 +test_branches = 4 +test_count = 231 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/marco-lancini--goscan.17b0823/tests/Dockerfile b/marco-lancini--goscan.17b0823/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_01.tar.gz b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a4c6b59339899cdee545f8bc7191ce0c5fc01bcb --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c72044afe0f48b0769897e77372faa5aa781296ac3ad25c8148df844c1f21e64 +size 6737 diff --git a/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_02.tar.gz b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cea1a0759ac58122bbe914ee7de18aeb1f605e2d --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbda96fa7a66fec234ba1909d9719f03a63aa0695689bbf8ce0f0d5404e4edf5 +size 10044 diff --git a/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_03.tar.gz b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c4308fe11cc0dc4e75d46ee451bbe90472063c26 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27bd69d0750b5473d5c5aced748f96105c21d69d3f62589c8f86d232fef841b4 +size 12215 diff --git a/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_04.tar.gz b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e8845be68085fdd2aabe584f66af6a953f094084 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33af5098c58638bf4a103cb446744c627cbc3c82e915b09acc7fc606f6a754ac +size 14720 diff --git a/marco-lancini--goscan.17b0823/tests/download.sh b/marco-lancini--goscan.17b0823/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..ef9cf369da6426a2ffe9929a30e85024caba1703 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/download.sh @@ -0,0 +1,203 @@ +#!/usr/bin/env bash +# Manually recovered and independently validated ProgramGym build contract. +set -euo pipefail +mkdir -p /workspace/.programgym_build_env/go-prefetch +export GOTOOLCHAIN=auto +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF' +module github.com/marco-lancini/goscan + +go 1.20 + +require ( + github.com/c-bata/go-prompt v0.2.6 + github.com/fatih/color v1.7.0 + github.com/jinzhu/gorm v1.9.11 + github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523 + github.com/olekukonko/tablewriter v0.0.4 +) + +require ( + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/mattn/go-colorable v0.1.7 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mattn/go-sqlite3 v1.11.0 // indirect + github.com/mattn/go-tty v0.0.3 // indirect + github.com/pkg/term v1.2.0-beta.2 // indirect + golang.org/x/sys v0.0.0-20200918174421-af09f7315aff // indirect +) +PB_MANUAL_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PB_MANUAL_GO_SUM_EOF' +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU= +cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/c-bata/go-prompt v0.2.6 h1:POP+nrHE+DfLYx370bedwNhsqmpCUynWPxuHi0C5vZI= +github.com/c-bata/go-prompt v0.2.6/go.mod h1:/LMAke8wD2FsNu9EXNdHxNLbd9MedkPnCdfpU9wwHfY= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA= +github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jinzhu/gorm v1.9.11 h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE= +github.com/jinzhu/gorm v1.9.11/go.mod h1:bu/pK8szGZ2puuErfU0RwyeNdsf3e6nCX/noXaVxkfw= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523 h1:N4NQR4on0n3Kc3xlBXUYzCZorFdordwkR2kcZMk9te0= +github.com/lair-framework/go-nmap v0.0.0-20191202052157-3507e0b03523/go.mod h1:7Em1Lxm3DFdLvXWUZ6bQ/xIbGlxFy7jl07bziQMZ/kU= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= +github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw= +github.com/pkg/term v1.2.0-beta.2/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +PB_MANUAL_GO_SUM_EOF +cd /workspace/.programgym_build_env/go-prefetch +PB_RECOVERY_GOROOT="$(go env GOROOT)" +mkdir -p /opt/programgym-go-toolchain +cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/ +export GOROOT=/opt/programgym-go-toolchain +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all diff --git a/marco-lancini--goscan.17b0823/tests/executable b/marco-lancini--goscan.17b0823/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..68ab91236bce7b278718a5be12b597bb6e59c66d --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4d94963ac62bf14f4850f54c9f1e2cddb2b68fce9831c4913876c2155ef507b +size 12392480 diff --git a/marco-lancini--goscan.17b0823/tests/programgym-go.tar.gz b/marco-lancini--goscan.17b0823/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/marco-lancini--goscan.17b0823/tests/programgym_evaluator.py b/marco-lancini--goscan.17b0823/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/marco-lancini--goscan.17b0823/tests/programgym_task.json b/marco-lancini--goscan.17b0823/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..ad8eac190be83d507d84ae4096abbc6de1d9d23d --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/programgym_task.json @@ -0,0 +1,395 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_banner_config.TestBanner.test_banner_prints_version_header", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_banner_config.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_dispatch.TestHelp.test_help_table_columns", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_dispatch.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_dispatch.TestShellExit.test_repl_prompt_rendered", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_dispatch.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_banner_config.TestBanner.test_banner_art_first_line", + "eval.tests.test_banner_config.TestBanner.test_banner_contains_ascii_art", + "eval.tests.test_banner_config.TestBanner.test_banner_prints_version_header", + "eval.tests.test_banner_config.TestConfigInit.test_connected_to_db_logged", + "eval.tests.test_banner_config.TestConfigInit.test_creates_output_goscan_dir", + "eval.tests.test_banner_config.TestConfigInit.test_db_path_env_no_default_in_output", + "eval.tests.test_banner_config.TestConfigInit.test_db_path_env_overrides", + "eval.tests.test_banner_config.TestConfigInit.test_default_db_inside_output_dir", + "eval.tests.test_banner_config.TestMissingTtyError.test_non_tty_reports_no_tty_panic", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[en]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[ex]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[he]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[lo]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[po]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[s]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[se]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[sho]", + "eval.tests.test_cli_completer.TestCommandCompleter.test_command_suggestions[sp]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_alive_subcommand_suggestions", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[enumerate_A]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[load_a]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[load_p]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[load_t]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[portscan_T]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[set_n]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[set_w]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[show_h]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[show_p]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[show_t]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[special_d]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[special_e]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_subcommand_suggestions[sweep_P]", + "eval.tests.test_cli_completer.TestSubcommandCompleter.test_target_subcommand_suggestions", + "eval.tests.test_cli_dispatch.TestArgValidation.test_missing_required_args_rejected[enumerate]", + "eval.tests.test_cli_dispatch.TestArgValidation.test_missing_required_args_rejected[portscan]", + "eval.tests.test_cli_dispatch.TestArgValidation.test_missing_required_args_rejected[show]", + "eval.tests.test_cli_dispatch.TestArgValidation.test_missing_required_args_rejected[sweep]", + "eval.tests.test_cli_dispatch.TestHelp.test_help_lists_exit_entry", + "eval.tests.test_cli_dispatch.TestHelp.test_help_shows_section_heading", + "eval.tests.test_cli_dispatch.TestHelp.test_help_table_columns", + "eval.tests.test_cli_dispatch.TestLoad.test_load_alive_single_imports", + "eval.tests.test_cli_dispatch.TestLoad.test_load_target_invalid_ip_handled", + "eval.tests.test_cli_dispatch.TestLoad.test_load_target_single_imports", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[SWEEP]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[TCP_FULL]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[TCP_PROD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[TCP_STANDARD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[TCP_VULN]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[UDP_PROD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_nmap_switches_updates_value[UDP_STANDARD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_output_folder_creates_dir", + "eval.tests.test_cli_dispatch.TestSet.test_set_output_folder_reopens_db", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[DNS_BRUTEFORCE]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[FINGER_USER]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[FTP_USER]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[HYDRA_FTP_PASSWORD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[HYDRA_FTP_USER]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[HYDRA_SSH_PASSWORD]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[HYDRA_SSH_USER]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[SMTP]", + "eval.tests.test_cli_dispatch.TestSet.test_set_wordlists_updates_value[SNMP]", + "eval.tests.test_cli_dispatch.TestShellExit.test_exit_command_exits_cleanly", + "eval.tests.test_cli_dispatch.TestShellExit.test_quit_alias_exits_cleanly", + "eval.tests.test_cli_dispatch.TestShellExit.test_repl_prompt_rendered", + "eval.tests.test_cli_dispatch.TestShowEmpty.test_show_empty_database[show hosts-No hosts are up!]", + "eval.tests.test_cli_dispatch.TestShowEmpty.test_show_empty_database[show ports-No hosts are up!]", + "eval.tests.test_cli_dispatch.TestShowEmpty.test_show_empty_database[show targets-No targets imported]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_hosts.test_load_alive_multi_from_file", + "eval.tests.test_hosts.test_load_alive_single_persists[10.9.9.9]", + "eval.tests.test_hosts.test_load_alive_single_persists[192.168.50.3]", + "eval.tests.test_hosts.test_show_hosts_empty", + "eval.tests.test_hosts.test_show_hosts_new_host_has_no_ports", + "eval.tests.test_portscan.test_load_portscan_dedups_ports_on_reimport", + "eval.tests.test_portscan.test_load_portscan_from_folder", + "eval.tests.test_portscan.test_load_portscan_host_up_no_ports", + "eval.tests.test_portscan.test_load_portscan_imports_host_ports_services", + "eval.tests.test_portscan.test_load_portscan_multiple_hosts_in_one_xml", + "eval.tests.test_portscan.test_load_portscan_rejects_non_xml", + "eval.tests.test_portscan.test_load_portscan_service_formatting[xml0-expected_rows0]", + "eval.tests.test_portscan.test_load_portscan_service_formatting[xml1-expected_rows1]", + "eval.tests.test_portscan.test_load_portscan_sets_host_os_and_ports", + "eval.tests.test_show_utils.test_alive_single_then_show_hosts_step", + "eval.tests.test_show_utils.test_enumerate_invalid_arg_count", + "eval.tests.test_show_utils.test_help_renders_command_table", + "eval.tests.test_show_utils.test_portscan_invalid_arg_count", + "eval.tests.test_show_utils.test_show_invalid_arg_count", + "eval.tests.test_show_utils.test_show_ports_empty", + "eval.tests.test_show_utils.test_show_unknown_subcommand", + "eval.tests.test_show_utils.test_startup_initialises_db", + "eval.tests.test_show_utils.test_sweep_invalid_arg_count", + "eval.tests.test_targets.test_load_target_multi_dedups_duplicates", + "eval.tests.test_targets.test_load_target_multi_from_file", + "eval.tests.test_targets.test_load_target_multi_missing_file", + "eval.tests.test_targets.test_load_target_single_cidr_form", + "eval.tests.test_targets.test_load_target_single_persists[10.0.0.1]", + "eval.tests.test_targets.test_load_target_single_persists[172.16.0.7]", + "eval.tests.test_targets.test_load_target_single_persists[192.168.1.10]", + "eval.tests.test_targets.test_set_output_folder_reinits_db", + "eval.tests.test_targets.test_show_targets_empty" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_dns.test_dns_bad_kind_rejected", + "eval.tests.test_dns.test_dns_bruteforce_reverse_completes", + "eval.tests.test_dns.test_dns_bruteforce_reverse_target_in_output", + "eval.tests.test_dns.test_dns_bruteforce_uses_configured_wordlist", + "eval.tests.test_dns.test_dns_discovery_runs_nmap_stage", + "eval.tests.test_dns.test_dns_discovery_stages", + "eval.tests.test_dns.test_dns_discovery_target_with_slash_is_cleaned", + "eval.tests.test_domain.test_domain_bad_kind_rejected", + "eval.tests.test_domain.test_domain_hosts_runs_shell_grep", + "eval.tests.test_domain.test_domain_hosts_sections", + "eval.tests.test_domain.test_domain_hosts_uses_outfolder_in_command", + "eval.tests.test_domain.test_domain_missing_kind_panics", + "eval.tests.test_domain.test_domain_servers_sections", + "eval.tests.test_domain.test_domain_users_sections", + "eval.tests.test_eyewitness.test_eyewitness_creates_output_tree", + "eval.tests.test_eyewitness.test_eyewitness_emits_command_and_result_marker", + "eval.tests.test_eyewitness.test_eyewitness_follows_configured_outfolder", + "eval.tests.test_eyewitness.test_eyewitness_writes_source_file", + "eval.tests.test_nmap.test_dns_cleanpath_of_slash_target_used_in_dirs", + "eval.tests.test_nmap.test_nmap_switches_rewrite_affects_next_sweep", + "eval.tests.test_nmap.test_sweep_command_escapes_cleanpath", + "eval.tests.test_nmap.test_sweep_command_reaches_executing_command_line", + "eval.tests.test_nmap.test_sweep_dedicated_output_dir_created", + "eval.tests.test_portscan.test_load_portscan_closed_port_is_listed", + "eval.tests.test_portscan.test_load_portscan_extracts_os", + "eval.tests.test_portscan.test_load_portscan_extracts_ports_and_services", + "eval.tests.test_portscan.test_load_portscan_extracts_service_version", + "eval.tests.test_portscan.test_load_portscan_folder_loads_xml", + "eval.tests.test_portscan.test_load_portscan_https_versioned", + "eval.tests.test_portscan.test_load_portscan_multi_host_and_ldap", + "eval.tests.test_portscan.test_load_portscan_non_xml_file_rejected", + "eval.tests.test_portscan.test_portscan_extra_args_rejected", + "eval.tests.test_portscan.test_portscan_invalid_kind_rejected", + "eval.tests.test_portscan.test_portscan_lowercase_kind_not_dispatched", + "eval.tests.test_portscan.test_portscan_missing_target_rejected", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[TCP-FULL-Starting full TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[TCP-PROD-Starting production TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[TCP-STANDARD-Starting top 200 TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[TCP-VULN-SCAN-Starting TCP vuln scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[UDP-PROD-Starting production UDP port scan (common ports)]", + "eval.tests.test_portscan.test_portscan_valid_kind_dispatches[UDP-STANDARD-Starting UDP port scan (common ports)]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[TCP-FULL-Starting full TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[TCP-PROD-Starting production TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[TCP-STANDARD-Starting top 200 TCP port scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[TCP-VULN-SCAN-Starting TCP vuln scan]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[UDP-PROD-Starting production UDP port scan (common ports)]", + "eval.tests.test_portscan.test_portscan_valid_kind_reaches_exec_scan[UDP-STANDARD-Starting UDP port scan (common ports)]", + "eval.tests.test_sweep.test_sweep_all_dispatches", + "eval.tests.test_sweep.test_sweep_extra_arg_rejected", + "eval.tests.test_sweep.test_sweep_invalid_type_rejected", + "eval.tests.test_sweep.test_sweep_lowercase_type_rejected", + "eval.tests.test_sweep.test_sweep_missing_arg_rejected", + "eval.tests.test_sweep.test_sweep_ping_dispatches", + "eval.tests.test_sweep.test_sweep_ping_reaches_exec_sweep", + "eval.tests.test_utils.test_dns_bruteforce_writes_output_file", + "eval.tests.test_utils.test_dns_reverse_bruteforce_writes_output_file", + "eval.tests.test_utils.test_logger_error_marker_on_missing_file", + "eval.tests.test_utils.test_logger_info_notify_and_debug_markers", + "eval.tests.test_utils.test_parse_address_accepts_bare_ip", + "eval.tests.test_utils.test_parse_address_accepts_cidr", + "eval.tests.test_utils.test_set_config_file_replays_commands", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[SWEEP]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[TCP_FULL]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[TCP_PROD]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[TCP_STANDARD]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[TCP_VULN]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[UDP_PROD]", + "eval.tests.test_utils.test_set_nmap_switches_reports_previous_and_updated[UDP_STANDARD]", + "eval.tests.test_utils.test_set_output_folder_reinits_db", + "eval.tests.test_utils.test_set_wordlists_rewrites_dns_wordlist" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_enum_args.test_enumerate_case_sensitive_politeness", + "eval.tests.test_enum_args.test_enumerate_unknown_kind_no_handler", + "eval.tests.test_enum_args.test_enumerate_wrong_arity_rejected[enumerate SSH DRY]", + "eval.tests.test_enum_args.test_enumerate_wrong_arity_rejected[enumerate SSH]", + "eval.tests.test_enum_args.test_enumerate_wrong_arity_rejected[enumerate]", + "eval.tests.test_enum_command_details.test_dns_command_details", + "eval.tests.test_enum_command_details.test_finger_command_details", + "eval.tests.test_enum_command_details.test_rdp_command_details", + "eval.tests.test_enum_command_details.test_smb_command_details", + "eval.tests.test_enum_command_details.test_smb_single_pass_for_445", + "eval.tests.test_enum_command_details.test_smtp_command_details", + "eval.tests.test_enum_command_details.test_wordlist_config_reaches_hydra", + "eval.tests.test_enum_http_scheme.test_http_dirb_scheme[443-https-https]", + "eval.tests.test_enum_http_scheme.test_http_dirb_scheme[443-ssl/http-https]", + "eval.tests.test_enum_http_scheme.test_http_dirb_scheme[80-http-http]", + "eval.tests.test_enum_http_scheme.test_http_dirb_scheme[8080-http-alt-http]", + "eval.tests.test_enum_http_scheme.test_http_dirb_scheme[8443-https-https]", + "eval.tests.test_enum_http_scheme.test_http_dry_includes_nikto_dirb", + "eval.tests.test_enum_http_scheme.test_http_multiple_ports_both_schemes", + "eval.tests.test_enum_runmodes.test_aggressive_ftp_adds_hydra", + "eval.tests.test_enum_runmodes.test_bruteforce_http_adds_sqlmap_and_fimap", + "eval.tests.test_enum_runmodes.test_dry_all_never_executes", + "eval.tests.test_enum_runmodes.test_dry_ftp_only_builds_nmap_command", + "eval.tests.test_enum_runmodes.test_dry_ssh_only_builds_hydra", + "eval.tests.test_enum_runmodes.test_polite_ftp_executes_nmap_and_enum", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[DNS-5353-dns-dns_nmap]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[FTP-2021-ms-wbt-server-ftp-user-enum.pl]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[HTTP-8081-http-dirb http://192.0.2.9:8081]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[RDP-3333-ms-wbt-server-rdp-vuln-ms12-020]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SMB-4445-smb-enum4linux -a 192.0.2.9]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SMTP-2500-smtp-smtp-user-enum -M VRFY]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SNMP-1161-snmp-snmpwalk -c public -v1]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SQL-14333-ms-sql-s-ms-sql-info]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SQL-15210-oracle-oracle-enum-users]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SQL-33060-mysql-mysql-info]", + "eval.tests.test_enum_service_matchers.test_service_name_matcher_dispatches[SSH-2200-ssh-hydra]", + "eval.tests.test_enum_service_matchers.test_snmp_service_name_builds_snmpwalk", + "eval.tests.test_enum_service_matchers.test_ssh_service_name_picks_verbatim_port", + "eval.tests.test_enum_sql_multi.test_sql_all_three_backends", + "eval.tests.test_enum_sql_multi.test_sql_mssql_nmap_command", + "eval.tests.test_enum_sql_multi.test_sql_mysql_nmap_command", + "eval.tests.test_enum_sql_multi.test_sql_nonstandard_service_port", + "eval.tests.test_enum_sql_multi.test_sql_oracle_sid_arg", + "eval.tests.test_enum_target_filter.test_scope_by_all_enumerates_every_host", + "eval.tests.test_enum_target_filter.test_scope_by_exact_address", + "eval.tests.test_enum_target_filter.test_scope_per_protocol_host_isolation", + "eval.tests.test_enum_target_filter.test_scope_unknown_address_no_worker", + "eval.tests.test_enumerate_dispatch.test_enum_all_dispatch_all_protocols", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[DNS-192.0.2.7:53 (domain)--sU -p53,53]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[FINGER-192.0.2.7:79 (finger)-finger-user-enum.pl]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[FTP-192.0.2.7:21 (ftp)-ftp-user-enum.pl]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[HTTP-192.0.2.7:80 (http)-dirb http://192.0.2.7:80]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[RDP-192.0.2.7:3389 (ms-wbt-server)-rdp-vuln-ms12-020]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[SMB-192.0.2.7:139 (netbios-ssn)-enum4linux -a 192.0.2.7]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[SMTP-192.0.2.7:25 (smtp)-smtp-user-enum -M VRFY]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[SNMP-192.0.2.7:161 (snmp)-snmpwalk -c public -v1]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[SQL-192.0.2.7:1521 (oracle)-sql_oracle_nmap_1521]", + "eval.tests.test_enumerate_dispatch.test_enum_kind_dispatch[SSH-192.0.2.7:22 (ssh)-hydra]", + "eval.tests.test_enumerate_politeness.test_ftp_polite_suppresses_hydra", + "eval.tests.test_enumerate_politeness.test_http_dry_shows_all_http_tools", + "eval.tests.test_enumerate_politeness.test_http_polite_suppresses_aggressive_tools", + "eval.tests.test_enumerate_politeness.test_ssh_aggressive_executes_hydra", + "eval.tests.test_enumerate_politeness.test_ssh_bruteforce_executes_hydra", + "eval.tests.test_enumerate_politeness.test_ssh_dry_shows_hydra_command", + "eval.tests.test_enumerate_politeness.test_ssh_polite_suppresses_hydra" + ] + } + }, + "commit": "17b08232200e6d34b8f71cd7f235e0923ae79e1a", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.4763968267253302, + "eval_clean_hashes": [ + "a4d94963ac62bf14f4850f54c9f1e2cddb2b68fce9831c4913876c2155ef507b" + ], + "input_record": { + "commit": "17b08232200e6d34b8f71cd7f235e0923ae79e1a", + "commits": 83, + "contributors": 2, + "difficulty": "easy", + "difficulty_code_lines": 2995, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 2995, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.4763968267253302, + "difficulty_test_code_lines": 0, + "full_name": "marco-lancini/goscan", + "github_stars": 1036, + "input_joern_zip": "go_joern/marco-lancini__goscan.zip", + "joern_status": true, + "joern_time": 17.794292057864368, + "language": "go", + "pb_match": [ + { + "pb_fullname": "guumaster/hostctl", + "rank": 950, + "similarity": 0.4462922513484955 + }, + { + "pb_fullname": "sheepla/pingu", + "rank": 22, + "similarity": 0.580157995223999 + }, + { + "pb_fullname": "raviqqe/muffet", + "rank": 55, + "similarity": 0.5839454531669617 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 770, + "similarity": 0.4850878119468689 + } + ], + "repo_age": 8.21, + "repo_path": "go/marco-lancini__goscan", + "source": "commit:17b08232200e6d34b8f71cd7f235e0923ae79e1a", + "status": "done", + "url": "https://github.com/marco-lancini/goscan" + }, + "instance_id": "marco-lancini__goscan.17b0823", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + } + ], + "repository": "marco-lancini/goscan" +} diff --git a/marco-lancini--goscan.17b0823/tests/test.sh b/marco-lancini--goscan.17b0823/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/marco-lancini--goscan.17b0823/tests/workspace.tar.gz b/marco-lancini--goscan.17b0823/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7420f502929d5acefe4abbed6792fa08ae6d070f --- /dev/null +++ b/marco-lancini--goscan.17b0823/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8df11ff43048bf1777e582607647e2097402244b7dd88b6b31dbc240c3b011c +size 2729 diff --git a/marcusbuffett--pipe-rename.be217/environment/Dockerfile b/marcusbuffett--pipe-rename.be217/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/marcusbuffett--pipe-rename.be217/environment/download.sh b/marcusbuffett--pipe-rename.be217/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2273d17b1d2cc9acdc6cc902ac7ad5f8bdd0e916 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/environment/download.sh @@ -0,0 +1,963 @@ +#!/usr/bin/env bash +# download.sh - prefetch every Cargo dependency required to build the +# pipe-rename "renamer" binary. This script is SOURCED (not executed) by the +# validator while the repository tree is not yet available, so it must be fully +# standalone: it generates its own temporary Cargo manifest + Cargo.lock from +# inline data and runs the cargo dependency-fetch command against that generated +# manifest. It +# performs NO build/compile/test step; it only downloads dependencies into the +# isolated cargo cache. +# +# The embedded Cargo.lock below is byte-identical to the repository's committed +# lockfile, and the generated manifest mirrors the repository's Cargo.toml. With +# `--locked`, cargo downloads precisely the crates/versions the offline build in +# build.sh will need, guaranteeing a cache hit with no network in build.sh. + +# Source-safe failure helper. We never use `exit` in normal control flow and +# never redirect return/errors to /dev/null. +_fail() { + echo "download.sh: ERROR: $1" + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Root of a temporary directory that does not exist in the read-only /source_ro +# mount. Everything download.sh writes lives here; nothing touches the repo. +DL_RUST_ROOT="${XDG_CACHE_HOME:-$HOME/.cache}/programgym_dl" +mkdir -p "$DL_RUST_ROOT" +if [ ! -d "$DL_RUST_ROOT" ]; then + _fail "cannot create temporary dir $DL_RUST_ROOT" +fi + +# Isolate the cargo cache so the prefetched crates are shared with build.sh. +export CARGO_HOME="$DL_RUST_ROOT/cargo-home" +mkdir -p "$CARGO_HOME" +if [ ! -d "$CARGO_HOME" ]; then + _fail "cannot create CARGO_HOME $CARGO_HOME" +fi + +# Explicit target directory (unused by fetch, but kept consistent for build.sh). +export CARGO_TARGET_DIR="$DL_RUST_ROOT/target" + +# --------------------------------------------------------------------------- +# Generate a temporary cargo project mirroring pipe-rename's Cargo.toml and +# Cargo.lock, entirely from inline data. download.sh never reads the repo. +# --------------------------------------------------------------------------- +GEN_DIR="$DL_RUST_ROOT/manifest" +rm -rf "$GEN_DIR" +mkdir -p "$GEN_DIR/src" +if [ ! -d "$GEN_DIR/src" ]; then + _fail "cannot create manifest dirs under $GEN_DIR" +fi + +# Minimal stub so cargo accepts the [[bin]] path (fetch never compiles it). +cat > "$GEN_DIR/src/main.rs" <<'RUST_STUB' +fn main() {} +RUST_STUB + +cat > "$GEN_DIR/Cargo.toml" <<'CARGO_TOML' +[package] +name = "pipe-rename" +version = "1.6.7" +edition = "2018" + +[[bin]] +name = "renamer" +path = "src/main.rs" + +[dependencies] +anyhow = "1.0.32" +thiserror = "1.0.20" +subprocess = "0.2.4" +clap = { version = "3.0.1", features = ["derive"] } +shell-words = "1.0.0" +tempfile = "3.1.0" +dialoguer = "0.6.2" +ansi_term = "0.12.1" +diff = "0.1.12" +wild = "2" +serde = { version = "1.0.152", features = ["derive"] } +serde_json = "1.0.91" + +[dev-dependencies] +assert_cmd = "1.0.1" +predicates = "1.0.5" +CARGO_TOML + +# The exact dependency resolution the repository commits to. This is what the +# offline build in build.sh must satisfy, so `--locked` against this identical +# lock guarantees every needed crate version is present in CARGO_HOME. +cat > "$GEN_DIR/Cargo.lock" <<'CARGO_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "assert_cmd" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" +dependencies = [ + "bstr", + "doc-comment", + "predicates 2.1.5", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "console" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c0994e656bba7b922d8dd1245db90672ffb701e684e45be58f20719d69abc5a" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "termios", + "unicode-width", + "winapi", + "winapi-util", +] + +[[package]] +name = "dialoguer" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aa86af7b19b40ef9cbef761ed411a49f0afa06b7b6dcd3dfe2f96a3c546138" +dependencies = [ + "console", + "lazy_static", + "tempfile", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "float-cmp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "pipe-rename" +version = "1.6.7" +dependencies = [ + "ansi_term", + "anyhow", + "assert_cmd", + "clap", + "dialoguer", + "diff", + "predicates 1.0.8", + "serde", + "serde_json", + "shell-words", + "subprocess", + "tempfile", + "thiserror", + "wild", +] + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "itertools", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subprocess" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "wild" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b116685a6be0c52f5a103334cbff26db643826c7b3735fc0a3ba9871310a74" +dependencies = [ + "glob", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +CARGO_LOCK + +# Resolve against the embedded lock: this downloads every pinned crate into the +# isolated CARGO_HOME. It does NOT compile, link, test, or build anything. +cargo fetch --manifest-path "$GEN_DIR/Cargo.toml" --locked +_fetch_rc=$? +if [ "$_fetch_rc" -ne 0 ]; then + _fail "dependency prefetch via cargo failed with status $_fetch_rc" +fi + +echo "download.sh: Cargo dependencies prefetched into $CARGO_HOME" diff --git a/marcusbuffett--pipe-rename.be217/environment/executable b/marcusbuffett--pipe-rename.be217/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..31a6240c06c092901ea734261218f76cb2b67a6e --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:945fc36d92ced731720219a572107cc9d091977ac02c4a0068d26c2fac88ba76 +size 1006952 diff --git a/marcusbuffett--pipe-rename.be217/environment/harbor_prepare_download_env.sh b/marcusbuffett--pipe-rename.be217/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marcusbuffett--pipe-rename.be217/environment/workspace.tar.gz b/marcusbuffett--pipe-rename.be217/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..216c2745ce45233f4d86cdc79ee190d43881a6a4 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39a0c59f5c9e0657259e624c1e8472e2f8662db55101c0510d4e0ba058e57465 +size 3509 diff --git a/marcusbuffett--pipe-rename.be217/instruction.md b/marcusbuffett--pipe-rename.be217/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/marcusbuffett--pipe-rename.be217/solution/solve.sh b/marcusbuffett--pipe-rename.be217/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/marcusbuffett--pipe-rename.be217/task.toml b/marcusbuffett--pipe-rename.be217/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5983b22932fa65eb5bdd52ed9b4816122f435198 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/marcusbuffett--pipe-rename.be217" +description = "Synthetic ProgramGym cleanroom reconstruction task for marcusbuffett/pipe-rename" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "marcusbuffett__pipe-rename.be217f1" +repository = "marcusbuffett/pipe-rename" +commit = "be217f1ef2352cee122d9fe64a95051b26999d73" +language = "rust" +difficulty = "easy" +difficulty_score = 1.9112108931375529 +test_branches = 2 +test_count = 218 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/marcusbuffett--pipe-rename.be217/tests/Dockerfile b/marcusbuffett--pipe-rename.be217/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_module_01.tar.gz b/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e7d999f930e6b9fcf7692e60c4bd02b7c193a672 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:430f93a0c6ebc0eb2219b9a4650ede2075c4bb6e347bd46480d6e6c30a242be5 +size 20987 diff --git a/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_upstream.tar.gz b/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3eac0762664f58bfd513b502ed5123112ed9d241 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ba15979d86f3df1ae80be9828e858546b571aa26091c95277a01e8178a4193b +size 5721 diff --git a/marcusbuffett--pipe-rename.be217/tests/download.sh b/marcusbuffett--pipe-rename.be217/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..2273d17b1d2cc9acdc6cc902ac7ad5f8bdd0e916 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/download.sh @@ -0,0 +1,963 @@ +#!/usr/bin/env bash +# download.sh - prefetch every Cargo dependency required to build the +# pipe-rename "renamer" binary. This script is SOURCED (not executed) by the +# validator while the repository tree is not yet available, so it must be fully +# standalone: it generates its own temporary Cargo manifest + Cargo.lock from +# inline data and runs the cargo dependency-fetch command against that generated +# manifest. It +# performs NO build/compile/test step; it only downloads dependencies into the +# isolated cargo cache. +# +# The embedded Cargo.lock below is byte-identical to the repository's committed +# lockfile, and the generated manifest mirrors the repository's Cargo.toml. With +# `--locked`, cargo downloads precisely the crates/versions the offline build in +# build.sh will need, guaranteeing a cache hit with no network in build.sh. + +# Source-safe failure helper. We never use `exit` in normal control flow and +# never redirect return/errors to /dev/null. +_fail() { + echo "download.sh: ERROR: $1" + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Root of a temporary directory that does not exist in the read-only /source_ro +# mount. Everything download.sh writes lives here; nothing touches the repo. +DL_RUST_ROOT="${XDG_CACHE_HOME:-$HOME/.cache}/programgym_dl" +mkdir -p "$DL_RUST_ROOT" +if [ ! -d "$DL_RUST_ROOT" ]; then + _fail "cannot create temporary dir $DL_RUST_ROOT" +fi + +# Isolate the cargo cache so the prefetched crates are shared with build.sh. +export CARGO_HOME="$DL_RUST_ROOT/cargo-home" +mkdir -p "$CARGO_HOME" +if [ ! -d "$CARGO_HOME" ]; then + _fail "cannot create CARGO_HOME $CARGO_HOME" +fi + +# Explicit target directory (unused by fetch, but kept consistent for build.sh). +export CARGO_TARGET_DIR="$DL_RUST_ROOT/target" + +# --------------------------------------------------------------------------- +# Generate a temporary cargo project mirroring pipe-rename's Cargo.toml and +# Cargo.lock, entirely from inline data. download.sh never reads the repo. +# --------------------------------------------------------------------------- +GEN_DIR="$DL_RUST_ROOT/manifest" +rm -rf "$GEN_DIR" +mkdir -p "$GEN_DIR/src" +if [ ! -d "$GEN_DIR/src" ]; then + _fail "cannot create manifest dirs under $GEN_DIR" +fi + +# Minimal stub so cargo accepts the [[bin]] path (fetch never compiles it). +cat > "$GEN_DIR/src/main.rs" <<'RUST_STUB' +fn main() {} +RUST_STUB + +cat > "$GEN_DIR/Cargo.toml" <<'CARGO_TOML' +[package] +name = "pipe-rename" +version = "1.6.7" +edition = "2018" + +[[bin]] +name = "renamer" +path = "src/main.rs" + +[dependencies] +anyhow = "1.0.32" +thiserror = "1.0.20" +subprocess = "0.2.4" +clap = { version = "3.0.1", features = ["derive"] } +shell-words = "1.0.0" +tempfile = "3.1.0" +dialoguer = "0.6.2" +ansi_term = "0.12.1" +diff = "0.1.12" +wild = "2" +serde = { version = "1.0.152", features = ["derive"] } +serde_json = "1.0.91" + +[dev-dependencies] +assert_cmd = "1.0.1" +predicates = "1.0.5" +CARGO_TOML + +# The exact dependency resolution the repository commits to. This is what the +# offline build in build.sh must satisfy, so `--locked` against this identical +# lock guarantees every needed crate version is present in CARGO_HOME. +cat > "$GEN_DIR/Cargo.lock" <<'CARGO_LOCK' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "assert_cmd" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" +dependencies = [ + "bstr", + "doc-comment", + "predicates 2.1.5", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "console" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c0994e656bba7b922d8dd1245db90672ffb701e684e45be58f20719d69abc5a" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "regex", + "terminal_size", + "termios", + "unicode-width", + "winapi", + "winapi-util", +] + +[[package]] +name = "dialoguer" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aa86af7b19b40ef9cbef761ed411a49f0afa06b7b6dcd3dfe2f96a3c546138" +dependencies = [ + "console", + "lazy_static", + "tempfile", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "float-cmp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "pipe-rename" +version = "1.6.7" +dependencies = [ + "ansi_term", + "anyhow", + "assert_cmd", + "clap", + "dialoguer", + "diff", + "predicates 1.0.8", + "serde", + "serde_json", + "shell-words", + "subprocess", + "tempfile", + "thiserror", + "wild", +] + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "itertools", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subprocess" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "unicode-ident" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "wild" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b116685a6be0c52f5a103334cbff26db643826c7b3735fc0a3ba9871310a74" +dependencies = [ + "glob", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +CARGO_LOCK + +# Resolve against the embedded lock: this downloads every pinned crate into the +# isolated CARGO_HOME. It does NOT compile, link, test, or build anything. +cargo fetch --manifest-path "$GEN_DIR/Cargo.toml" --locked +_fetch_rc=$? +if [ "$_fetch_rc" -ne 0 ]; then + _fail "dependency prefetch via cargo failed with status $_fetch_rc" +fi + +echo "download.sh: Cargo dependencies prefetched into $CARGO_HOME" diff --git a/marcusbuffett--pipe-rename.be217/tests/executable b/marcusbuffett--pipe-rename.be217/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..31a6240c06c092901ea734261218f76cb2b67a6e --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:945fc36d92ced731720219a572107cc9d091977ac02c4a0068d26c2fac88ba76 +size 1006952 diff --git a/marcusbuffett--pipe-rename.be217/tests/harbor_prepare_download_env.sh b/marcusbuffett--pipe-rename.be217/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/marcusbuffett--pipe-rename.be217/tests/programgym_evaluator.py b/marcusbuffett--pipe-rename.be217/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/marcusbuffett--pipe-rename.be217/tests/programgym_task.json b/marcusbuffett--pipe-rename.be217/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..a4c8176cdedbd668e2f320ea0a57208369994023 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/programgym_task.json @@ -0,0 +1,403 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_text_diff.test_all_unchanged_multi_batch_no_replacements", + "eval.tests.test_text_diff.test_batch_drops_unchanged_file_and_renames_changed", + "eval.tests.test_text_diff.test_custom_rename_command_cp", + "eval.tests.test_text_diff.test_duplicate_input_errors", + "eval.tests.test_text_diff.test_duplicate_output_errors", + "eval.tests.test_text_diff.test_editor_failure_aborts_without_renaming", + "eval.tests.test_text_diff.test_editor_program_with_multiple_tokens_parsed", + "eval.tests.test_text_diff.test_filenames_only_barefile_in_cwd", + "eval.tests.test_text_diff.test_filenames_only_keeps_dir_and_renames", + "eval.tests.test_text_diff.test_filenames_only_mixed_dir_and_bare_batch", + "eval.tests.test_text_diff.test_force_overwrites_existing", + "eval.tests.test_text_diff.test_help_lists_pretty_diff_and_editor", + "eval.tests.test_text_diff.test_multitoken_custom_rename_command_cp_verbose", + "eval.tests.test_text_diff.test_no_input_errors", + "eval.tests.test_text_diff.test_no_replacements_errors", + "eval.tests.test_text_diff.test_nonexistent_input_errors", + "eval.tests.test_text_diff.test_overwrite_refused_without_force", + "eval.tests.test_text_diff.test_parents_creates_missing_dirs", + "eval.tests.test_text_diff.test_parents_filenames_only_plain_renames_in_subdir", + "eval.tests.test_text_diff.test_plain_mode_green_arrow", + "eval.tests.test_text_diff.test_pretty_diff_multi[a.mp3+b.tar.gz+c.doc]", + "eval.tests.test_text_diff.test_pretty_diff_multi[a.mp3+b.wav]", + "eval.tests.test_text_diff.test_pretty_diff_multi[a.txt+b.txt]", + "eval.tests.test_text_diff.test_pretty_diff_multi[aa+bb+cc+dd]", + "eval.tests.test_text_diff.test_pretty_diff_multi[aaa+bb+ccccc]", + "eval.tests.test_text_diff.test_pretty_diff_multi[aaa+bbb]", + "eval.tests.test_text_diff.test_pretty_diff_multi[draft.md+final.md]", + "eval.tests.test_text_diff.test_pretty_diff_multi[img1.png+img2.png+img3.png]", + "eval.tests.test_text_diff.test_pretty_diff_multi[item_one+item_two]", + "eval.tests.test_text_diff.test_pretty_diff_multi[keep.txt+drop_me.txt]", + "eval.tests.test_text_diff.test_pretty_diff_multi[one+two+three]", + "eval.tests.test_text_diff.test_pretty_diff_multi[report_1+report_2]", + "eval.tests.test_text_diff.test_pretty_diff_multi[seq_a+seq_b]", + "eval.tests.test_text_diff.test_pretty_diff_multi[u.txt+v.txt+w.txt]", + "eval.tests.test_text_diff.test_pretty_diff_multi[x_old+y_old]", + "eval.tests.test_text_diff.test_pretty_diff_renames_on_disk", + "eval.tests.test_text_diff.test_pretty_diff_single[01init->02init]", + "eval.tests.test_text_diff.test_pretty_diff_single[111->222]", + "eval.tests.test_text_diff.test_pretty_diff_single[12->123]", + "eval.tests.test_text_diff.test_pretty_diff_single[2023_report->2024_report]", + "eval.tests.test_text_diff.test_pretty_diff_single[99problems->100problems]", + "eval.tests.test_text_diff.test_pretty_diff_single[AAA_->BBB_]", + "eval.tests.test_text_diff.test_pretty_diff_single[Cargo.toml->Cargo.lock]", + "eval.tests.test_text_diff.test_pretty_diff_single[Draft->DRAFT]", + "eval.tests.test_text_diff.test_pretty_diff_single[LowerCase->lowercase]", + "eval.tests.test_text_diff.test_pretty_diff_single[MAIN->main]", + "eval.tests.test_text_diff.test_pretty_diff_single[M\\xfcnchen->M\\xfcnich]", + "eval.tests.test_text_diff.test_pretty_diff_single[README->readme]", + "eval.tests.test_text_diff.test_pretty_diff_single[README.md->README.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[READ_ME->read.me]", + "eval.tests.test_text_diff.test_pretty_diff_single[Text->text]", + "eval.tests.test_text_diff.test_pretty_diff_single[The Quick Brown Fox->The Lazy Dog]", + "eval.tests.test_text_diff.test_pretty_diff_single[UPPER->upper]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\u30d5\\u30a1\\u30a4\\u30eb->\\u30d5\\u30a1\\u30a4\\u30eb2]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\u623b\\u308b->\\u623b\\u308b.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\u6771\\u4eac->Tokyo]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\u6d4b\\u8bd5->test]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\xf6_\\xe4_\\xfc->oe_ae_ue]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\xfcber->uber]", + "eval.tests.test_text_diff.test_pretty_diff_single[\\xfcn\\xefcode->unicod\\xe9]", + "eval.tests.test_text_diff.test_pretty_diff_single[a->ab]", + "eval.tests.test_text_diff.test_pretty_diff_single[a->b]", + "eval.tests.test_text_diff.test_pretty_diff_single[a.b.c->a-b-c]", + "eval.tests.test_text_diff.test_pretty_diff_single[a.b.c.d->a.b.d.c]", + "eval.tests.test_text_diff.test_pretty_diff_single[a.b.c.d->a.x.c.y]", + "eval.tests.test_text_diff.test_pretty_diff_single[a.txt->b.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[aXbXc->aYbYc]", + "eval.tests.test_text_diff.test_pretty_diff_single[a_b_c_d->a-b-c-d]", + "eval.tests.test_text_diff.test_pretty_diff_single[aaaa->bbbb]", + "eval.tests.test_text_diff.test_pretty_diff_single[aaaaa->aaaa]", + "eval.tests.test_text_diff.test_pretty_diff_single[aab->aabc]", + "eval.tests.test_text_diff.test_pretty_diff_single[ab->a]", + "eval.tests.test_text_diff.test_pretty_diff_single[ab->acb]", + "eval.tests.test_text_diff.test_pretty_diff_single[abc->abcXYZ]", + "eval.tests.test_text_diff.test_pretty_diff_single[abc->abd0]", + "eval.tests.test_text_diff.test_pretty_diff_single[abc->abd1]", + "eval.tests.test_text_diff.test_pretty_diff_single[abc->prefix_abc]", + "eval.tests.test_text_diff.test_pretty_diff_single[abc123->abc456]", + "eval.tests.test_text_diff.test_pretty_diff_single[abcabc->abcabd]", + "eval.tests.test_text_diff.test_pretty_diff_single[abcd->abce]", + "eval.tests.test_text_diff.test_pretty_diff_single[abcdef->abf]", + "eval.tests.test_text_diff.test_pretty_diff_single[abcdefgh->abcdefgj]", + "eval.tests.test_text_diff.test_pretty_diff_single[address->addresses]", + "eval.tests.test_text_diff.test_pretty_diff_single[alpha->omega]", + "eval.tests.test_text_diff.test_pretty_diff_single[archive.tar.gz->archive.zip]", + "eval.tests.test_text_diff.test_pretty_diff_single[archived notes->reorganized notes]", + "eval.tests.test_text_diff.test_pretty_diff_single[backup_old->backup_new]", + "eval.tests.test_text_diff.test_pretty_diff_single[bat->cat]", + "eval.tests.test_text_diff.test_pretty_diff_single[bbbbb->ccccc]", + "eval.tests.test_text_diff.test_pretty_diff_single[beginning->ending]", + "eval.tests.test_text_diff.test_pretty_diff_single[bookkeeping->booping]", + "eval.tests.test_text_diff.test_pretty_diff_single[build.rs->build.cargo]", + "eval.tests.test_text_diff.test_pretty_diff_single[caf\\xe9->Caf\\xe9]", + "eval.tests.test_text_diff.test_pretty_diff_single[caf\\xe9-na\\xefve->cafe-naive]", + "eval.tests.test_text_diff.test_pretty_diff_single[caf\\xe9.txt->cafe.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[camelCase->camel_case]", + "eval.tests.test_text_diff.test_pretty_diff_single[captial->capital]", + "eval.tests.test_text_diff.test_pretty_diff_single[cat->cut]", + "eval.tests.test_text_diff.test_pretty_diff_single[cat->dog]", + "eval.tests.test_text_diff.test_pretty_diff_single[coffee->coffe]", + "eval.tests.test_text_diff.test_pretty_diff_single[completely.different.name.txt->a.wholly.new.filename.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[config->my_config]", + "eval.tests.test_text_diff.test_pretty_diff_single[cpp->c]", + "eval.tests.test_text_diff.test_pretty_diff_single[dash-name->dash_name]", + "eval.tests.test_text_diff.test_pretty_diff_single[data->data_old]", + "eval.tests.test_text_diff.test_pretty_diff_single[data[1].json->data[2].json]", + "eval.tests.test_text_diff.test_pretty_diff_single[data_0001.bin->data_0002.bin]", + "eval.tests.test_text_diff.test_pretty_diff_single[deep.dir.name->deep-dir-name]", + "eval.tests.test_text_diff.test_pretty_diff_single[emoji\\U0001f389->emoji.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[file->file.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[file.txt->file.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[file.txt->file]", + "eval.tests.test_text_diff.test_pretty_diff_single[file_backup_old->file_backup_new]", + "eval.tests.test_text_diff.test_pretty_diff_single[foo.www.txt->foo.whodat.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[foo123bar->foo456bar]", + "eval.tests.test_text_diff.test_pretty_diff_single[fragment->fagment]", + "eval.tests.test_text_diff.test_pretty_diff_single[game.exe->game.app]", + "eval.tests.test_text_diff.test_pretty_diff_single[gamma->delta]", + "eval.tests.test_text_diff.test_pretty_diff_single[header.h->header.hpp]", + "eval.tests.test_text_diff.test_pretty_diff_single[hello Hello HELLO->hello Hello WORLD]", + "eval.tests.test_text_diff.test_pretty_diff_single[hello.txt->hello.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[hello.txt->hello.txt.bak]", + "eval.tests.test_text_diff.test_pretty_diff_single[hello_world->hw]", + "eval.tests.test_text_diff.test_pretty_diff_single[image_001.png->image_002.png]", + "eval.tests.test_text_diff.test_pretty_diff_single[img10.png->img11.png]", + "eval.tests.test_text_diff.test_pretty_diff_single[int_float->float_int]", + "eval.tests.test_text_diff.test_pretty_diff_single[keep.dots->keep.dots.v2]", + "eval.tests.test_text_diff.test_pretty_diff_single[key_light->key_lite]", + "eval.tests.test_text_diff.test_pretty_diff_single[koltuk.tar.gz->sofa.tar.gz]", + "eval.tests.test_text_diff.test_pretty_diff_single[left->right]", + "eval.tests.test_text_diff.test_pretty_diff_single[lib.rs->lib.crate.rs]", + "eval.tests.test_text_diff.test_pretty_diff_single[lower_upper->LOWER_UPPER]", + "eval.tests.test_text_diff.test_pretty_diff_single[main.rs->main]", + "eval.tests.test_text_diff.test_pretty_diff_single[map->mop]", + "eval.tests.test_text_diff.test_pretty_diff_single[module_alpha.rs->module_beta.rs]", + "eval.tests.test_text_diff.test_pretty_diff_single[much_longer->short]", + "eval.tests.test_text_diff.test_pretty_diff_single[my file.txt->my file.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[my-file.name->my-file.name.bak]", + "eval.tests.test_text_diff.test_pretty_diff_single[na\\xefve->naive]", + "eval.tests.test_text_diff.test_pretty_diff_single[name2023->name2024]", + "eval.tests.test_text_diff.test_pretty_diff_single[night.txt->midnight.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[node_v1.12.0.tar.gz->node_v1.13.0.tar.gz]", + "eval.tests.test_text_diff.test_pretty_diff_single[note->notation]", + "eval.tests.test_text_diff.test_pretty_diff_single[notes->notes.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[notes.md->notes]", + "eval.tests.test_text_diff.test_pretty_diff_single[old_file.txt->newer_file.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[old_version->new_version]", + "eval.tests.test_text_diff.test_pretty_diff_single[one->two]", + "eval.tests.test_text_diff.test_pretty_diff_single[paper->paper.pdf]", + "eval.tests.test_text_diff.test_pretty_diff_single[photo.jpg->photo.jpeg]", + "eval.tests.test_text_diff.test_pretty_diff_single[pkg->pkg_v2]", + "eval.tests.test_text_diff.test_pretty_diff_single[pkg-a-1.2.3->pkg-a-1.2.4]", + "eval.tests.test_text_diff.test_pretty_diff_single[prefix->suffix]", + "eval.tests.test_text_diff.test_pretty_diff_single[read_me.TXT->read_me.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[readme.txt.v1->readme.txt.v2]", + "eval.tests.test_text_diff.test_pretty_diff_single[report.md->REPORT.markdown]", + "eval.tests.test_text_diff.test_pretty_diff_single[report_->reportX]", + "eval.tests.test_text_diff.test_pretty_diff_single[report_2023_final_draft.txt->report_2024_final_version.md]", + "eval.tests.test_text_diff.test_pretty_diff_single[report_v1.txt->report_v2.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[returner->return]", + "eval.tests.test_text_diff.test_pretty_diff_single[section->sections]", + "eval.tests.test_text_diff.test_pretty_diff_single[short->longer]", + "eval.tests.test_text_diff.test_pretty_diff_single[song.mp3->track.mp3]", + "eval.tests.test_text_diff.test_pretty_diff_single[spaced name.txt->spaced.name.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[start->finish]", + "eval.tests.test_text_diff.test_pretty_diff_single[stepone->steptwo]", + "eval.tests.test_text_diff.test_pretty_diff_single[successor->predecessor]", + "eval.tests.test_text_diff.test_pretty_diff_single[temp_a->final_a]", + "eval.tests.test_text_diff.test_pretty_diff_single[test_data.csv->test_data.tsv]", + "eval.tests.test_text_diff.test_pretty_diff_single[under_score->under-score]", + "eval.tests.test_text_diff.test_pretty_diff_single[v1.0.0->v1.1.0]", + "eval.tests.test_text_diff.test_pretty_diff_single[version_1->release_1]", + "eval.tests.test_text_diff.test_pretty_diff_single[version_1.0.txt->version_2.0.txt]", + "eval.tests.test_text_diff.test_pretty_diff_single[video (HD).mp4->video (4K).mp4]", + "eval.tests.test_text_diff.test_pretty_diff_single[with space->with_space]", + "eval.tests.test_text_diff.test_pretty_diff_single[x->xy]", + "eval.tests.test_text_diff.test_pretty_diff_single[x_y_z->x_y_w]", + "eval.tests.test_text_diff.test_pretty_diff_single[xx_yy_zz->xx_zz]", + "eval.tests.test_text_diff.test_pretty_diff_single[xyz->xy]", + "eval.tests.test_text_diff.test_pretty_diff_single[xyzxyzxyz->xyz]", + "eval.tests.test_text_diff.test_pretty_diff_single[z->zz]", + "eval.tests.test_text_diff.test_pretty_diff_single[zigzag->zizag]", + "eval.tests.test_text_diff.test_pretty_diff_single[zzzzyyyy->zzzzwwww]", + "eval.tests.test_text_diff.test_pretty_rename_into_missing_parent_without_parents_fails", + "eval.tests.test_text_diff.test_quiet_multi_batch_renames_with_no_output", + "eval.tests.test_text_diff.test_quiet_overrides_pretty_diff_still_renames", + "eval.tests.test_text_diff.test_quiet_suppresses_pretty_diff_but_renames", + "eval.tests.test_text_diff.test_rename_into_missing_parent_without_parents_fails", + "eval.tests.test_text_diff.test_short_flag_d_is_short_pretty_diff", + "eval.tests.test_text_diff.test_stdin_input_reaches_pretty_diff", + "eval.tests.test_text_diff.test_stdin_multi_file_batch_pretty_diff", + "eval.tests.test_text_diff.test_tilde_new_name_expands_home_and_renames", + "eval.tests.test_text_diff.test_tilde_not_expanded_when_not_at_path_start", + "eval.tests.test_text_diff.test_unequal_lines_errors", + "eval.tests.test_text_diff.test_version_flag" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_errors.test_duplicate_input", + "eval.tests.test_errors.test_duplicate_output", + "eval.tests.test_errors.test_editor_terminated_unexpectedly", + "eval.tests.test_errors.test_new_dir_without_parents", + "eval.tests.test_errors.test_no_input", + "eval.tests.test_errors.test_no_replacements", + "eval.tests.test_errors.test_nonexistent_input_file", + "eval.tests.test_errors.test_refusing_to_overwrite", + "eval.tests.test_errors.test_unequal_lines", + "eval.tests.test_options.test_filenames_only_renames_basename", + "eval.tests.test_options.test_force_overwrites_existing_file", + "eval.tests.test_options.test_parents_creates_directories", + "eval.tests.test_options.test_quiet_suppresses_replacement_listing", + "eval.tests.test_options.test_rename_command_invoked_with_old_and_new", + "eval.tests.test_options.test_undo_restores_previous_rename", + "eval.tests.test_options.test_undo_without_history_aborts", + "eval.tests.test_rename.test_content_preserved", + "eval.tests.test_rename.test_multiple_files", + "eval.tests.test_rename.test_no_change_row_keeps_only_changed_files", + "eval.tests.test_rename.test_one_file_positional_arg", + "eval.tests.test_rename.test_single_rename[option-like-name]", + "eval.tests.test_rename.test_single_rename[single]", + "eval.tests.test_rename.test_single_rename[with-space]" + ] + } + }, + "commit": "be217f1ef2352cee122d9fe64a95051b26999d73", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9112108931375529, + "eval_clean_hashes": [ + "945fc36d92ced731720219a572107cc9d091977ac02c4a0068d26c2fac88ba76" + ], + "input_record": { + "codeql_db_mb": 84.07, + "codeql_status": true, + "codeql_time": 44.661702655255795, + "commit": "be217f1ef2352cee122d9fe64a95051b26999d73", + "commits": 169, + "contributors": 8, + "difficulty": "easy", + "difficulty_code_lines": 627, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 627, + "difficulty_runtime_deps": 12, + "difficulty_score": 1.9112108931375529, + "difficulty_test_code_lines": 344, + "full_name": "marcusbuffett/pipe-rename", + "github_stars": 438, + "input_codeql_db": "rust_codeql/marcusbuffett__pipe-rename", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "rvben/rumdl", + "rank": 748, + "similarity": 0.44163668155670166 + }, + { + "pb_fullname": "jhspetersson/fselect", + "rank": 565, + "similarity": 0.4440956115722656 + }, + { + "pb_fullname": "dalance/amber", + "rank": 173, + "similarity": 0.5321171283721924 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 940, + "similarity": 0.432563453912735 + }, + { + "pb_fullname": "sstadick/hck", + "rank": 174, + "similarity": 0.47852349281311035 + }, + { + "pb_fullname": "ismaelgv/rnr", + "rank": 4, + "similarity": 0.6196711659431458 + }, + { + "pb_fullname": "riquito/tuc", + "rank": 97, + "similarity": 0.4910600781440735 + }, + { + "pb_fullname": "simeg/eureka", + "rank": 617, + "similarity": 0.4795601963996887 + }, + { + "pb_fullname": "clog-tool/clog-cli", + "rank": 434, + "similarity": 0.45226824283599854 + }, + { + "pb_fullname": "rhysd/kiro-editor", + "rank": 111, + "similarity": 0.6021636724472046 + }, + { + "pb_fullname": "chmln/sd", + "rank": 46, + "similarity": 0.5675569772720337 + }, + { + "pb_fullname": "kyoheiu/felix", + "rank": 382, + "similarity": 0.5420045256614685 + }, + { + "pb_fullname": "chmln/handlr", + "rank": 104, + "similarity": 0.5517398118972778 + }, + { + "pb_fullname": "konradsz/igrep", + "rank": 531, + "similarity": 0.4904395639896393 + }, + { + "pb_fullname": "Canop/broot", + "rank": 571, + "similarity": 0.5026700496673584 + }, + { + "pb_fullname": "sharkdp/fd", + "rank": 559, + "similarity": 0.4381173849105835 + }, + { + "pb_fullname": "anordal/shellharden", + "rank": 819, + "similarity": 0.46206870675086975 + }, + { + "pb_fullname": "sharkdp/bat", + "rank": 404, + "similarity": 0.5125694870948792 + }, + { + "pb_fullname": "yassinebridi/serpl", + "rank": 317, + "similarity": 0.57110595703125 + }, + { + "pb_fullname": "yaa110/nomino", + "rank": 3, + "similarity": 0.6553410887718201 + } + ], + "repo_age": 5.9, + "repo_path": "rust/marcusbuffett__pipe-rename", + "rust_channel": "stable", + "rust_edition": "2018", + "rust_release_date": "2018-12-06", + "rust_version": "1.31.0", + "rust_version_source": "edition", + "source": "commit:be217f1ef2352cee122d9fe64a95051b26999d73", + "status": "done", + "url": "https://github.com/marcusbuffett/pipe-rename" + }, + "instance_id": "marcusbuffett__pipe-rename.be217f1", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "tests", + "termination_reason": "early_stopping" + } + ], + "repository": "marcusbuffett/pipe-rename" +} diff --git a/marcusbuffett--pipe-rename.be217/tests/test.sh b/marcusbuffett--pipe-rename.be217/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/marcusbuffett--pipe-rename.be217/tests/workspace.tar.gz b/marcusbuffett--pipe-rename.be217/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..216c2745ce45233f4d86cdc79ee190d43881a6a4 --- /dev/null +++ b/marcusbuffett--pipe-rename.be217/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39a0c59f5c9e0657259e624c1e8472e2f8662db55101c0510d4e0ba058e57465 +size 3509 diff --git a/marianogappa--chart.3be5b2b/environment/Dockerfile b/marianogappa--chart.3be5b2b/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6f371332b0892136e00733449b81644d11444adf --- /dev/null +++ b/marianogappa--chart.3be5b2b/environment/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/marianogappa--chart.3be5b2b/environment/download.sh b/marianogappa--chart.3be5b2b/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a73fa4c2d239462069880dedd41849615da48f56 --- /dev/null +++ b/marianogappa--chart.3be5b2b/environment/download.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download stage for github.com/marianogappa/chart. +# +# This Go module has exactly one external dependency: github.com/skratchdot/open-golang +# v0.0.0-20200116055534-eef842397966. The download validation stage runs in a +# read-only mount that contains ONLY this file, so we must NOT read the +# repository's go.mod / go.sum. Instead we embed the module metadata inline, +# write it to a fixed literal directory, and run `go mod download` with an +# explicit literal -modfile path pointing at that inline-generated go.mod. This +# prefetches the single dependency into Go's default module cache so the +# offline build.sh can compile with no network access. +# +# This script is sourced (`source /source_ro/download.sh`), so it must not use +# `exit` in normal control flow and must leave exported vars in the shell. + +set -o errexit + +# Fixed literal directory in which we generate the module metadata inline. The +# same literal paths are used for the heredocs and for the -modfile argument so +# the dependency-prefetch manifest provenance is statically verifiable. +mkdir -p /tmp/programgym-chart-go-download + +cat > /tmp/programgym-chart-go-download/go.mod <<'EOF' +module github.com/marianogappa/chart + +go 1.18 + +require github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 +EOF + +cat > /tmp/programgym-chart-go-download/go.sum <<'EOF' +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +EOF + +# Choose an explicitly reachable module proxy. The pipeline's default GOPROXY +# is an internal mirror (https://proxy.golang.org) that +# is unreachable from the download-validation sandbox (dial tcp i/o timeout). +# https://proxy.golang.org (with a direct fallback) is reachable and is what we +# prefetch from here into Go's default module cache. Nothing is compiled, +# linked, or tested in this stage. +export GOPROXY="https://proxy.golang.org,direct" + +# cd is required so Go discovers the module root from the working directory. +# -modfile uses the explicit literal path to the inline-generated go.mod so only +# this module's dependency is prefetched into the default GOMODCACHE. +cd /tmp/programgym-chart-go-download +go mod download -modfile /tmp/programgym-chart-go-download/go.mod diff --git a/marianogappa--chart.3be5b2b/environment/executable b/marianogappa--chart.3be5b2b/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..218277493485b69da0f5699b285897427feb4587 --- /dev/null +++ b/marianogappa--chart.3be5b2b/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a05721594befb9fb3adf311eaf31a47d40872d6f7e9e0f28fd3e5912f3ce411 +size 5247407 diff --git a/marianogappa--chart.3be5b2b/environment/programgym-go.tar.gz b/marianogappa--chart.3be5b2b/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/marianogappa--chart.3be5b2b/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/marianogappa--chart.3be5b2b/environment/workspace.tar.gz b/marianogappa--chart.3be5b2b/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fe55c38c0690b18164c61cbf7292512a13442f1a --- /dev/null +++ b/marianogappa--chart.3be5b2b/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f5d72c69c368b16256895dbc2fbf66df6b3aba1dd2524c7cda1669b59eeba88 +size 2940 diff --git a/marianogappa--chart.3be5b2b/instruction.md b/marianogappa--chart.3be5b2b/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/marianogappa--chart.3be5b2b/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/marianogappa--chart.3be5b2b/solution/solve.sh b/marianogappa--chart.3be5b2b/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/marianogappa--chart.3be5b2b/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/marianogappa--chart.3be5b2b/task.toml b/marianogappa--chart.3be5b2b/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..43f89a862e97aa61af1892f1ce854d08f5590f85 --- /dev/null +++ b/marianogappa--chart.3be5b2b/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/marianogappa--chart.3be5b2b" +description = "Synthetic ProgramGym cleanroom reconstruction task for marianogappa/chart" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "marianogappa__chart.3be5b2b" +repository = "marianogappa/chart" +commit = "3be5b2b8b13fec16afb881540ae835cb62a9b8c2" +language = "go" +difficulty = "easy" +difficulty_score = 1.9696022648485392 +test_branches = 4 +test_count = 423 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/marianogappa--chart.3be5b2b/tests/Dockerfile b/marianogappa--chart.3be5b2b/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bd5f12bacd787ef39a90a560bc0dec968dcdb06e --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_01.tar.gz b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6e62fd8b9ce121a3707761e7e7aab0adb1ba660e --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2485cb672bfdab0c5f77b5a1c8bccd7979c7639e34ecdc14763244585d084ab +size 5503 diff --git a/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_02.tar.gz b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7e63fb69eb3ba69e82a9146489db5afea0ac4c83 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d915ed2af8f6707afc4b6fcd651757535aa8439bef9c22c1753c01ad40bc76d +size 7809 diff --git a/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_03.tar.gz b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..08d299fe3151faf47166460d5a25056da62d3b99 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd3d138b001560e4a610ae9236c6a8a7f77736460e03c5a76da01bbc796795c0 +size 20783 diff --git a/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_04.tar.gz b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b95f8b8d4b7725bb35eaae21f1590f274345311c --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4f56bc09dbc66c25effa941c8b30a8e89911b7485870e4bd799f5e2e5d52e96 +size 14481 diff --git a/marianogappa--chart.3be5b2b/tests/download.sh b/marianogappa--chart.3be5b2b/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..a73fa4c2d239462069880dedd41849615da48f56 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/download.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download stage for github.com/marianogappa/chart. +# +# This Go module has exactly one external dependency: github.com/skratchdot/open-golang +# v0.0.0-20200116055534-eef842397966. The download validation stage runs in a +# read-only mount that contains ONLY this file, so we must NOT read the +# repository's go.mod / go.sum. Instead we embed the module metadata inline, +# write it to a fixed literal directory, and run `go mod download` with an +# explicit literal -modfile path pointing at that inline-generated go.mod. This +# prefetches the single dependency into Go's default module cache so the +# offline build.sh can compile with no network access. +# +# This script is sourced (`source /source_ro/download.sh`), so it must not use +# `exit` in normal control flow and must leave exported vars in the shell. + +set -o errexit + +# Fixed literal directory in which we generate the module metadata inline. The +# same literal paths are used for the heredocs and for the -modfile argument so +# the dependency-prefetch manifest provenance is statically verifiable. +mkdir -p /tmp/programgym-chart-go-download + +cat > /tmp/programgym-chart-go-download/go.mod <<'EOF' +module github.com/marianogappa/chart + +go 1.18 + +require github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 +EOF + +cat > /tmp/programgym-chart-go-download/go.sum <<'EOF' +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +EOF + +# Choose an explicitly reachable module proxy. The pipeline's default GOPROXY +# is an internal mirror (https://proxy.golang.org) that +# is unreachable from the download-validation sandbox (dial tcp i/o timeout). +# https://proxy.golang.org (with a direct fallback) is reachable and is what we +# prefetch from here into Go's default module cache. Nothing is compiled, +# linked, or tested in this stage. +export GOPROXY="https://proxy.golang.org,direct" + +# cd is required so Go discovers the module root from the working directory. +# -modfile uses the explicit literal path to the inline-generated go.mod so only +# this module's dependency is prefetched into the default GOMODCACHE. +cd /tmp/programgym-chart-go-download +go mod download -modfile /tmp/programgym-chart-go-download/go.mod diff --git a/marianogappa--chart.3be5b2b/tests/executable b/marianogappa--chart.3be5b2b/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..218277493485b69da0f5699b285897427feb4587 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a05721594befb9fb3adf311eaf31a47d40872d6f7e9e0f28fd3e5912f3ce411 +size 5247407 diff --git a/marianogappa--chart.3be5b2b/tests/programgym-go.tar.gz b/marianogappa--chart.3be5b2b/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/marianogappa--chart.3be5b2b/tests/programgym_evaluator.py b/marianogappa--chart.3be5b2b/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/marianogappa--chart.3be5b2b/tests/programgym_task.json b/marianogappa--chart.3be5b2b/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..db5a6d10a4ef3cb8b290e9a8d5b65da1e4c01382 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/programgym_task.json @@ -0,0 +1,644 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_options_module.test_bar_with_single_float_is_incompatible", + "eval.tests.test_options_module.test_bar_with_string_and_float_is_compatible", + "eval.tests.test_options_module.test_date_format_flag_sets_format_string", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[ANSIC]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[Kitchen]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC1123Z]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC1123]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC3339Nano]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC3339]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC822Z]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC822]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RFC850]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[RubyDate]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[StampMicro]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[StampMilli]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[Stamp]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[UnixDate]", + "eval.tests.test_options_module.test_date_format_hint_gives_resolved_layout[mysql]", + "eval.tests.test_options_module.test_date_hint_makes_column_parsed_as_date", + "eval.tests.test_options_module.test_date_only_dataset_incompatible_for_all_chart_types[bar]", + "eval.tests.test_options_module.test_date_only_dataset_incompatible_for_all_chart_types[line]", + "eval.tests.test_options_module.test_date_only_dataset_incompatible_for_all_chart_types[pie]", + "eval.tests.test_options_module.test_date_only_dataset_incompatible_for_all_chart_types[scatter]", + "eval.tests.test_options_module.test_default_df_resolves_to_pie", + "eval.tests.test_options_module.test_default_dff_resolves_to_scatter", + "eval.tests.test_options_module.test_default_ff_resolves_to_scatter", + "eval.tests.test_options_module.test_default_fff_resolves_to_scatter", + "eval.tests.test_options_module.test_default_s_resolves_to_pie", + "eval.tests.test_options_module.test_default_separator_is_tab_when_no_hint", + "eval.tests.test_options_module.test_default_sf_resolves_to_pie", + "eval.tests.test_options_module.test_default_sff_resolves_to_line", + "eval.tests.test_options_module.test_default_ss_resolves_to_pie", + "eval.tests.test_options_module.test_empty_dataset_error_also_without_debug", + "eval.tests.test_options_module.test_empty_dataset_errors_no_matter_hint", + "eval.tests.test_options_module.test_flag_order_after_positional_hint", + "eval.tests.test_options_module.test_help_exits_nonzero_and_prints_flag_usage[args0]", + "eval.tests.test_options_module.test_help_exits_nonzero_and_prints_flag_usage[args1]", + "eval.tests.test_options_module.test_help_exits_nonzero_and_prints_flag_usage[args2]", + "eval.tests.test_options_module.test_help_has_separator_section[args0]", + "eval.tests.test_options_module.test_help_has_separator_section[args1]", + "eval.tests.test_options_module.test_help_has_separator_section[args2]", + "eval.tests.test_options_module.test_help_lists_chart_type_hints_table[args0]", + "eval.tests.test_options_module.test_help_lists_chart_type_hints_table[args1]", + "eval.tests.test_options_module.test_help_lists_chart_type_hints_table[args2]", + "eval.tests.test_options_module.test_invalid_flag_prints_error_and_exits_nonzero", + "eval.tests.test_options_module.test_invalid_separator_hint_falls_back_to_tab", + "eval.tests.test_options_module.test_lineFormat_flag_suppresses_inference", + "eval.tests.test_options_module.test_line_with_date_and_two_floats_is_compatible", + "eval.tests.test_options_module.test_line_with_single_float_is_incompatible", + "eval.tests.test_options_module.test_line_with_two_floats_is_compatible", + "eval.tests.test_options_module.test_lineformat_d_date_column", + "eval.tests.test_options_module.test_multiple_positional_hints_combine", + "eval.tests.test_options_module.test_pie_with_date_and_float_is_compatible", + "eval.tests.test_options_module.test_pie_with_single_float_is_incompatible", + "eval.tests.test_options_module.test_pie_with_string_and_float_is_compatible", + "eval.tests.test_options_module.test_positional_bar_sets_chart_type_bar", + "eval.tests.test_options_module.test_positional_hint_after_flag_is_collected", + "eval.tests.test_options_module.test_positional_hint_before_first_flag_is_collected", + "eval.tests.test_options_module.test_positional_line_sets_chart_type_line", + "eval.tests.test_options_module.test_positional_log_sets_logarithmic_scale", + "eval.tests.test_options_module.test_positional_pie_sets_chart_type_pie", + "eval.tests.test_options_module.test_positional_scatter_sets_chart_type_scatter", + "eval.tests.test_options_module.test_scatter_with_no_floats_is_incompatible", + "eval.tests.test_options_module.test_scatter_with_two_floats_is_compatible", + "eval.tests.test_options_module.test_separator_hints[ -[space]]", + "eval.tests.test_options_module.test_separator_hints[,-[comma]]", + "eval.tests.test_options_module.test_separator_hints[;-[semicolon]]", + "eval.tests.test_options_module.test_single_string_column_gains_frequency_float", + "eval.tests.test_options_module.test_string_only_data_is_frequency_preprocessed", + "eval.tests.test_options_module.test_string_only_default_resolves_to_pie", + "eval.tests.test_options_module.test_title_flag_is_rendered_in_debug", + "eval.tests.test_options_module.test_title_short_flag", + "eval.tests.test_options_module.test_unknown_positional_hint_is_ignored", + "eval.tests.test_options_module.test_x_label_flag", + "eval.tests.test_options_module.test_y_label_flag", + "eval.tests.test_options_module.test_zero_based_flag_accepted" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.TestArgValidation.test_chart_type_hint_bar", + "eval.tests.test_cli.TestArgValidation.test_chart_type_hint_line", + "eval.tests.test_cli.TestArgValidation.test_chart_type_hint_scatter", + "eval.tests.test_cli.TestArgValidation.test_chart_type_hint_selects_pie", + "eval.tests.test_cli.TestArgValidation.test_default_scale_is_linear", + "eval.tests.test_cli.TestArgValidation.test_scale_type_hint_logarithmic", + "eval.tests.test_cli.TestArgValidation.test_unknown_flag_errors", + "eval.tests.test_cli.TestChartTypeResolution.test_auto_pie_for_string_float", + "eval.tests.test_cli.TestChartTypeResolution.test_auto_scatter_for_two_floats_no_strings", + "eval.tests.test_cli.TestHelp.test_help_lists_options_and_chart_types[--help]", + "eval.tests.test_cli.TestHelp.test_help_lists_options_and_chart_types[-h]", + "eval.tests.test_cli.TestHelp.test_help_lists_options_and_chart_types[help]", + "eval.tests.test_cli.TestHelp.test_help_usage_mentions_separator_hint", + "eval.tests.test_cli.TestTitleAndAxisLabels.test_no_labels_by_default", + "eval.tests.test_cli.TestTitleAndAxisLabels.test_title_and_axis_labels", + "eval.tests.test_dataset.TestColumnInventories.test_date_column_inventory", + "eval.tests.test_dataset.TestColumnInventories.test_float_cols_inventory", + "eval.tests.test_dataset.TestColumnInventories.test_string_and_float_inventory", + "eval.tests.test_dataset.TestDatasetEmptySlices.test_all_unparseable_rows_yield_empty_dataset", + "eval.tests.test_dataset.TestDatasetLenGate.test_empty_input_is_not_chartable", + "eval.tests.test_dataset.TestDatasetLenGate.test_no_data_without_debug_exits_zero_with_error", + "eval.tests.test_dataset.TestDatasetLenGate.test_non_chartable_single_float_col_reports_incompatible", + "eval.tests.test_dataset.TestLinesReadVsUsed.test_all_rows_parseable_read_equals_used", + "eval.tests.test_dataset.TestLinesReadVsUsed.test_malformed_float_row_skipped", + "eval.tests.test_dataset.TestLinesReadVsUsed.test_only_valid_float_rows_survive", + "eval.tests.test_dataset.TestLinesReadVsUsed.test_type_mismatch_against_explicit_format", + "eval.tests.test_format.TestExplicitLineFormat.test_explicit_format_date_string", + "eval.tests.test_format.TestExplicitLineFormat.test_explicit_format_surfaces_verbatim", + "eval.tests.test_format.TestExplicitLineFormat.test_invalid_line_format_letters_produce_empty_format", + "eval.tests.test_format.TestFormatDateClassification.test_date_float_is_df", + "eval.tests.test_format.TestFormatDateClassification.test_date_not_inferred_without_date_format", + "eval.tests.test_format.TestFormatDateClassification.test_float_date_is_fd", + "eval.tests.test_format.TestFormatDateClassification.test_mysql_hint_date", + "eval.tests.test_format.TestFormatDateClassification.test_rfc3339_hint_date", + "eval.tests.test_format.TestFormatMajorityAndTies.test_mixed_columns_format_string", + "eval.tests.test_format.TestFormatNormalization.test_consecutive_separators_collapse", + "eval.tests.test_format.TestFormatNormalization.test_crlf_line_endings", + "eval.tests.test_format.TestFormatNormalization.test_line_format_survives_blank_lines", + "eval.tests.test_format.TestFormatNormalization.test_most_common_format_wins", + "eval.tests.test_format.TestFormatNormalization.test_space_adjacent_to_float_token_makes_it_string", + "eval.tests.test_format.TestFormatNormalization.test_trim_whitespace_around_columns", + "eval.tests.test_format.TestFormatSeparatorSelection.test_separator_reported[hint0-[comma]]", + "eval.tests.test_format.TestFormatSeparatorSelection.test_separator_reported[hint1-[semicolon]]", + "eval.tests.test_format.TestFormatSeparatorSelection.test_separator_reported[hint2-[space]]", + "eval.tests.test_format.TestFormatSeparatorSelection.test_separator_reported[hint3-[tab]]", + "eval.tests.test_format.TestFormatTypeClassification.test_float_then_string_is_fs", + "eval.tests.test_format.TestFormatTypeClassification.test_negative_and_decimal_floats", + "eval.tests.test_format.TestFormatTypeClassification.test_scientific_notation_floats", + "eval.tests.test_format.TestFormatTypeClassification.test_string_then_float_is_sf", + "eval.tests.test_format.TestFormatTypeClassification.test_three_floats[comma-1,2,3\\n-fff]", + "eval.tests.test_format.TestFormatTypeClassification.test_three_floats[semicolon-1;2;3\\n-fff]", + "eval.tests.test_format.TestFormatTypeClassification.test_three_floats[space-1 2 3\\n-fff]", + "eval.tests.test_format.TestFormatTypeClassification.test_three_floats[tab-1\\t2\\t3\\n-fff]", + "eval.tests.test_frequency.TestFreqBaseline.test_duplicate_labels_one_row_each", + "eval.tests.test_frequency.TestFreqBaseline.test_freq_applies_only_to_string_only_data", + "eval.tests.test_frequency.TestFreqBaseline.test_single_label_becomes_one_row", + "eval.tests.test_frequency.TestFreqBaseline.test_string_format_appended_float_in_inferred_format_string", + "eval.tests.test_frequency.TestFreqBaseline.test_three_distinct_labels_rows", + "eval.tests.test_frequency.TestFreqErrorPath.test_empty_string_column_infrastructure_no_rows", + "eval.tests.test_frequency.TestFreqInputVariants.test_freq_ignores_blank_and_trims[ a\\n b \\n c\\n-3]", + "eval.tests.test_frequency.TestFreqInputVariants.test_freq_ignores_blank_and_trims[a\\n\\nb\\n\\nc\\n-3]", + "eval.tests.test_frequency.TestFreqInputVariants.test_freq_ignores_blank_and_trims[a\\nb\\nc\\n-3]", + "eval.tests.test_frequency.TestFreqInputVariants.test_freq_ignores_blank_and_trims[a\\r\\nb\\r\\nc\\r\\n-3]", + "eval.tests.test_frequency.TestFreqInputVariants.test_freq_with_space_separator", + "eval.tests.test_frequency.TestFreqOrderingAndDominance.test_boundary_10_labels_no_other", + "eval.tests.test_frequency.TestFreqOrderingAndDominance.test_boundary_11_labels_other_bucket", + "eval.tests.test_frequency.TestFreqOrderingAndDominance.test_boundary_9_labels_no_other", + "eval.tests.test_frequency.TestFreqOrderingAndDominance.test_many_labels_capped_at_ten", + "eval.tests.test_frequency.TestFreqOrderingAndDominance.test_most_common_surfaces_row_count" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_chart_render.test_bar_tooltip_callback_returns_value", + "eval.tests.test_chart_render.test_barmulti_produces_category_datasets_with_repeated_colors", + "eval.tests.test_chart_render.test_barsingle_emits_one_filled_dataset_and_zero_based", + "eval.tests.test_chart_render.test_denormalised_datasets_sorted_alphabetically_by_label", + "eval.tests.test_chart_render.test_denormalised_scatterline_groups_by_string_label", + "eval.tests.test_chart_render.test_denormalised_uses_time_scale", + "eval.tests.test_chart_render.test_line_apply_border_and_background_color_index", + "eval.tests.test_chart_render.test_line_hint_two_float_cols_uses_scatterline_points", + "eval.tests.test_chart_render.test_line_single_series_over_rows_emits_simple_data", + "eval.tests.test_chart_render.test_line_tooltip_callback_handles_value_y", + "eval.tests.test_chart_render.test_line_with_string_and_two_float_cols_splits_into_datasets", + "eval.tests.test_chart_render.test_output_all_writes_complete_html_document", + "eval.tests.test_chart_render.test_output_html_carries_dependencies_and_chart_script", + "eval.tests.test_chart_render.test_output_html_embeds_chart_js_object", + "eval.tests.test_chart_render.test_pie_emits_labels_and_single_dataset[apple\\t1\\nbanana\\t2\\ncherry\\t3\\n-`apple`,`banana`,`cherry`]", + "eval.tests.test_chart_render.test_pie_emits_labels_and_single_dataset[x\\t10\\ny\\t20\\n-`x`,`y`]", + "eval.tests.test_chart_render.test_pie_no_legend_yaxes_section", + "eval.tests.test_chart_render.test_pie_sets_background_color_array_from_palette", + "eval.tests.test_chart_render.test_pie_tooltip_callback_reports_percent", + "eval.tests.test_chart_render.test_scatter_category_reuses_color_index", + "eval.tests.test_chart_render.test_scatter_inferred_from_two_floats_no_string", + "eval.tests.test_chart_render.test_scatter_radius_from_third_column_narrow_range", + "eval.tests.test_chart_render.test_scatter_sets_x_y_for_each_row", + "eval.tests.test_chart_render.test_scatter_tooltip_reports_label_and_point", + "eval.tests.test_chart_render.test_scatter_with_string_categories_groups_datasets", + "eval.tests.test_chart_render.test_scatterline_asks_linear_x_axis", + "eval.tests.test_chart_render.test_viewer_absent_produces_stderr_fatal_and_nonzero", + "eval.tests.test_color_options.test_bar_categories_from_string_column_as_slice_labels", + "eval.tests.test_color_options.test_bar_time_labels_use_timestamp_format", + "eval.tests.test_color_options.test_barsignle_zero_based_is_forced", + "eval.tests.test_color_options.test_color_cycle_wraps_after_palette_exhaustion", + "eval.tests.test_color_options.test_default_palette_used_when_no_color_hint", + "eval.tests.test_color_options.test_gradient_palette_uses_sequential_ramp", + "eval.tests.test_color_options.test_label_backtick_escaped", + "eval.tests.test_color_options.test_label_backtick_escaped_when_not_present", + "eval.tests.test_color_options.test_label_dollar_brace_escaped", + "eval.tests.test_color_options.test_label_trailing_backslash_escaped", + "eval.tests.test_color_options.test_label_uses_preprocess_backtick_wrapping", + "eval.tests.test_color_options.test_legacy_palette_uses_material_colors", + "eval.tests.test_color_options.test_linear_scale_default_y_axis_type", + "eval.tests.test_color_options.test_log_scale_sets_y_axis_type_logarithmic", + "eval.tests.test_color_options.test_long_label_is_cropped_with_ellipsis", + "eval.tests.test_color_options.test_no_title_sets_display_false", + "eval.tests.test_color_options.test_numeric_no_string_labels_use_slice_names", + "eval.tests.test_color_options.test_pie_color_palette_variant[hint0-colors0]", + "eval.tests.test_color_options.test_pie_color_palette_variant[hint1-colors1]", + "eval.tests.test_color_options.test_pie_color_palette_variant[hint2-colors2]", + "eval.tests.test_color_options.test_scatterline_time_x_axis_uses_timestamp_points", + "eval.tests.test_color_options.test_time_labels_use_nanosecond_format", + "eval.tests.test_color_options.test_title_display_and_text_in_chart_object", + "eval.tests.test_color_options.test_x_axis_label_in_scale_label", + "eval.tests.test_color_options.test_y_axis_label_absent_means_display_false", + "eval.tests.test_color_options.test_y_axis_label_in_scale_label", + "eval.tests.test_color_options.test_zero_based_explicit_flag_keeps_true_for_bar", + "eval.tests.test_debug.test_debug_blank_line_rows_are_skipped_but_counted", + "eval.tests.test_debug.test_debug_default_scale_is_linear", + "eval.tests.test_debug.test_debug_empty_input_reports_error", + "eval.tests.test_debug.test_debug_name_style_empty_report_no_crash", + "eval.tests.test_debug.test_debug_omits_axis_labels_when_not_set", + "eval.tests.test_debug.test_debug_omits_title_when_not_set", + "eval.tests.test_debug.test_debug_reports_column_counts[2012-01-02\\t5\\n2012-01-03\\t6\\n-expected_counts1]", + "eval.tests.test_debug.test_debug_reports_column_counts[apple\\t1\\nbanana\\t2\\n-expected_counts0]", + "eval.tests.test_debug.test_debug_reports_column_counts[foo\\nbar\\nbaz\\n-expected_counts2]", + "eval.tests.test_debug.test_debug_reports_date_column_and_date_format", + "eval.tests.test_debug.test_debug_reports_explicit_chart_type_hint[hint0-pie]", + "eval.tests.test_debug.test_debug_reports_explicit_chart_type_hint[hint1-bar]", + "eval.tests.test_debug.test_debug_reports_explicit_chart_type_hint[hint2-line]", + "eval.tests.test_debug.test_debug_reports_explicit_chart_type_hint[hint3-scatter]", + "eval.tests.test_debug.test_debug_reports_lines_read_matching_stdin_rows", + "eval.tests.test_debug.test_debug_reports_log_scale_hint", + "eval.tests.test_debug.test_debug_reports_separator[sep_arg0-apple\\t1\\nbanana\\t2\\n-[tab]]", + "eval.tests.test_debug.test_debug_reports_separator[sep_arg1-apple 1\\nbanana 2\\n-[space]]", + "eval.tests.test_debug.test_debug_reports_separator[sep_arg2-apple,1\\nbanana,2\\n-[comma]]", + "eval.tests.test_debug.test_debug_reports_separator[sep_arg3-apple;1\\nbanana;2\\n-[semicolon]]", + "eval.tests.test_debug.test_debug_reports_strings_only_data_resolved_to_pie", + "eval.tests.test_debug.test_debug_reports_title_flag[MyChart]", + "eval.tests.test_debug.test_debug_reports_title_flag[Revenue by Month]", + "eval.tests.test_debug.test_debug_reports_title_flag[alpha_beta]", + "eval.tests.test_debug.test_debug_reports_x_axis_label", + "eval.tests.test_debug.test_debug_reports_y_axis_label", + "eval.tests.test_debug.test_debug_short_title_flag", + "eval.tests.test_debug.test_debug_unanchored_non_chartable_input_still_reports", + "eval.tests.test_debug.test_debug_works_when_combined_with_chart_hint_and_flags", + "eval.tests.test_distinct_render_behaviors.test_denormalised_time_line_sorts_rows_chronologically", + "eval.tests.test_distinct_render_behaviors.test_line_scatterline_sorts_out_of_order_rows_by_x", + "eval.tests.test_distinct_render_behaviors.test_line_string_single_float_data_matches_preserved_order", + "eval.tests.test_distinct_render_behaviors.test_line_string_single_float_preserves_input_label_order", + "eval.tests.test_distinct_render_behaviors.test_line_strings_three_floats_sorts_labels_and_each_category_data", + "eval.tests.test_distinct_render_behaviors.test_line_strings_two_floats_sort_string_labels_to_follow_column_zero", + "eval.tests.test_distinct_render_behaviors.test_non_pie_uses_full_size_div_script_container[args0]", + "eval.tests.test_distinct_render_behaviors.test_non_pie_uses_full_size_div_script_container[args1]", + "eval.tests.test_distinct_render_behaviors.test_non_pie_uses_full_size_div_script_container[args2]", + "eval.tests.test_distinct_render_behaviors.test_pie_uses_pie_dedicated_div_script_container", + "eval.tests.test_distinct_render_behaviors.test_scatter_does_not_sort_rows_keeps_input_time_order", + "eval.tests.test_distinct_render_behaviors.test_scatter_keeps_string_category_input_order_unsorted", + "eval.tests.test_edges.test_bar_two_columns_treats_second_as_category", + "eval.tests.test_edges.test_bare_single_float_column_pie_is_incompatible", + "eval.tests.test_edges.test_blank_input_no_rows_treated_empty", + "eval.tests.test_edges.test_comma_separator_chart_builds", + "eval.tests.test_edges.test_empty_input_on_chart_path_goes_to_debug_error", + "eval.tests.test_edges.test_float_formatting_compact_scientific", + "eval.tests.test_edges.test_large_dataset_builds_successfully", + "eval.tests.test_edges.test_line_format_flag_overrides_inference", + "eval.tests.test_edges.test_mismatched_date_format_falls_back_to_string_column", + "eval.tests.test_edges.test_negative_floats_marshal_with_sign", + "eval.tests.test_edges.test_pie_multiple_floats_with_strings_produces_data", + "eval.tests.test_edges.test_pie_with_multiple_categories_uses_first_column_data_only", + "eval.tests.test_edges.test_rfc3339_named_date_hint_parses_rows", + "eval.tests.test_edges.test_scatter_default_radius_of_four_when_two_columns", + "eval.tests.test_edges.test_scatter_radius_wide_range_scales_between_4_and_54", + "eval.tests.test_edges.test_semicolon_separator_chart_builds", + "eval.tests.test_edges.test_space_separator_chart_builds", + "eval.tests.test_help.test_help_documents_chart_types_on_stdout", + "eval.tests.test_help.test_help_exit_is_fatal_but_usage_present", + "eval.tests.test_help.test_help_flag_after_data_args_still_wins", + "eval.tests.test_help.test_help_flags_printed_to_stderr", + "eval.tests.test_help.test_help_more_info_not_printed_for_normal_run", + "eval.tests.test_help.test_help_positional_hint_prints_usage_without_dash", + "eval.tests.test_help.test_short_h_flag_prints_usage", + "eval.tests.test_more_render_behaviors.test_bar_legacy_20_columns_wraps_palette_color", + "eval.tests.test_more_render_behaviors.test_bar_time_multiple_columns_yields_category_datasets", + "eval.tests.test_more_render_behaviors.test_bar_time_three_columns_use_repeated_backgrounds", + "eval.tests.test_more_render_behaviors.test_default_palette_no_wrap_before_palette_size_stays_distinct", + "eval.tests.test_more_render_behaviors.test_denormalised_labels_sorted_across_groups", + "eval.tests.test_more_render_behaviors.test_denormalised_single_label_accumulates_all_points", + "eval.tests.test_more_render_behaviors.test_denormalised_tooltip_uses_value_y", + "eval.tests.test_more_render_behaviors.test_pie_float_only_single_column_incompatible_without_string", + "eval.tests.test_more_render_behaviors.test_pie_float_only_uses_slice_labels_and_column0", + "eval.tests.test_more_render_behaviors.test_scatterline_dataset_count_is_column_count_minus_one[1\\t2\\n3\\t4\\n5\\t6\\n-1]", + "eval.tests.test_more_render_behaviors.test_scatterline_dataset_count_is_column_count_minus_one[1\\t2\\t10\\n3\\t4\\t20\\n5\\t6\\t30\\n-2]", + "eval.tests.test_more_render_behaviors.test_scatterline_dataset_count_is_column_count_minus_one[1\\t2\\t10\\t100\\n3\\t4\\t20\\t200\\n5\\t6\\t30\\t300\\n-3]", + "eval.tests.test_more_render_behaviors.test_scatterline_default_y_axis_not_zero_based", + "eval.tests.test_more_render_behaviors.test_scatterline_each_dataset_reuses_col0_as_x_and_next_col_as_y", + "eval.tests.test_more_render_behaviors.test_scatterline_linear_x_axis_and_empty_labels", + "eval.tests.test_more_render_behaviors.test_scatterline_one_dataset_hides_legend", + "eval.tests.test_more_render_behaviors.test_scatterline_two_datasets_shows_legend_bottom", + "eval.tests.test_more_render_behaviors.test_scatterline_zero_based_sets_begin_at_zero", + "eval.tests.test_more_render_behaviors.test_time_scatter_default_radius_when_single_float_column", + "eval.tests.test_more_render_behaviors.test_time_scatter_narrow_radius_uses_x_min_plus_four", + "eval.tests.test_more_render_behaviors.test_time_scatter_wide_radius_scales_with_fractional_midpoint", + "eval.tests.test_palette_and_scaling.test_bar_four_columns_each_dataset_holds_its_column", + "eval.tests.test_palette_and_scaling.test_bar_four_float_columns_yield_four_datasets", + "eval.tests.test_palette_and_scaling.test_bar_multi_gradient_repeats_gradient_colors", + "eval.tests.test_palette_and_scaling.test_bar_multi_legacy_repeats_legacy_colors", + "eval.tests.test_palette_and_scaling.test_bar_single_column_single_dataset", + "eval.tests.test_palette_and_scaling.test_line_single_series_uses_default_palette", + "eval.tests.test_palette_and_scaling.test_line_single_series_uses_gradient_first_color", + "eval.tests.test_palette_and_scaling.test_line_single_series_uses_legacy_first_color", + "eval.tests.test_palette_and_scaling.test_line_two_series_each_holds_its_column", + "eval.tests.test_palette_and_scaling.test_scatter_string_groups_use_gradient_colors", + "eval.tests.test_palette_and_scaling.test_title_applied_to_line_chart", + "eval.tests.test_palette_and_scaling.test_title_applied_to_multicolumn_bar_multi", + "eval.tests.test_palette_and_scaling.test_x_label_applied_to_time_scatter", + "eval.tests.test_radius_boundaries_and_timeseries.test_denormalised_line_tooltip_uses_value_y", + "eval.tests.test_radius_boundaries_and_timeseries.test_denormalised_line_zero_based_sets_begin_at_zero", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_negative_coordinates_render_verbatim", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_negative_with_radius_column", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_radius_range_1_single_narrow_point", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_radius_range_49_uses_narrow_branch", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_radius_range_exactly_50_uses_scaled_branch", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatter_zero_origin_point_preserved", + "eval.tests.test_radius_boundaries_and_timeseries.test_scatterline_tooltip_uses_value_y_two_floats", + "eval.tests.test_radius_boundaries_and_timeseries.test_time_scatter_without_zero_based_defaults_false", + "eval.tests.test_radius_boundaries_and_timeseries.test_time_scatter_zero_based_sets_begin_at_zero", + "eval.tests.test_time_series_and_options.test_bar_time_x_axis_builds_data_values", + "eval.tests.test_time_series_and_options.test_bar_time_x_axis_uses_timestamp_labels", + "eval.tests.test_time_series_and_options.test_line_three_float_columns_cycle_border_colors", + "eval.tests.test_time_series_and_options.test_line_three_float_columns_keep_fill_false", + "eval.tests.test_time_series_and_options.test_line_zero_based_flag_sets_begin_at_zero", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[ANSIC-Mon Jan 2 15:04:05 2006\\t5\\n-`2006-01-02T15:04:05`]", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[Kitchen-3:04PM\\t5\\n4:05PM\\t6\\n-`0000-01-01T15:04:00`,`0000-01-01T16:05:00`]", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[RFC1123-Mon, 02 Jan 2006 15:04:05 MST\\t5\\n-`2006-01-02T15:04:05`]", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[RFC3339Nano-2012-01-02T15:04:05.999999999Z\\t5\\n-`2012-01-02T15:04:05.999999999`]", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[StampMilli-Jan 2 15:04:05.000\\t5\\nJan 3 15:04:06.000\\t6\\n-`0000-01-02T15:04:05`,`0000-01-03T15:04:06`]", + "eval.tests.test_time_series_and_options.test_named_date_format_hint_timestamp_labels[mysql-2012-01-02 15:04:05\\t5\\n2012-01-03 15:04:06\\t6\\n-`2012-01-02T15:04:05`,`2012-01-03T15:04:06`]", + "eval.tests.test_time_series_and_options.test_pie_zero_based_flag_produces_no_y_axis", + "eval.tests.test_time_series_and_options.test_scatter_ungrouped_default_begin_at_zero_false", + "eval.tests.test_time_series_and_options.test_scatter_zero_based_flag_sets_begin_at_zero", + "eval.tests.test_time_series_and_options.test_time_scatter_axis_labels_roundtrip", + "eval.tests.test_time_series_and_options.test_time_scatter_default_radius_four", + "eval.tests.test_time_series_and_options.test_time_scatter_groups_points_by_string_label", + "eval.tests.test_time_series_and_options.test_time_scatter_log_scale_sets_logarithmic_y_axis", + "eval.tests.test_time_series_and_options.test_time_scatter_multi_ds_legend_shown_bottom", + "eval.tests.test_time_series_and_options.test_time_scatter_radius_from_second_float_column", + "eval.tests.test_time_series_and_options.test_time_scatter_ungrouped_single_category_dataset", + "eval.tests.test_time_series_and_options.test_time_scatter_with_string_groups_uses_time_axis" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_core_orchestration.test_bad_date_format_chartable_yet_charts", + "eval.tests.test_core_orchestration.test_bad_date_format_reclassifies_column_as_string", + "eval.tests.test_core_orchestration.test_empty_line_format_string_means_not_raw", + "eval.tests.test_core_orchestration.test_positional_debug_hint_emits_report", + "eval.tests.test_core_orchestration.test_positional_debug_hint_with_chart_type", + "eval.tests.test_core_orchestration.test_raw_line_format_with_invalid_letters_yields_empty_format", + "eval.tests.test_core_orchestration.test_unknown_flag_fatals_with_parse_error", + "eval.tests.test_debug_render.test_debug_all_newline_terminated_lines_are_counted", + "eval.tests.test_debug_render.test_debug_blank_stdin_not_chartable", + "eval.tests.test_debug_render.test_debug_chart_type_variants[a\\t1\\nb\\t2\\n-args0-Chart type\\tpie]", + "eval.tests.test_debug_render.test_debug_chart_type_variants[a\\t1\\nb\\t2\\n-args1-Chart type\\tpie]", + "eval.tests.test_debug_render.test_debug_chart_type_variants[a\\t1\\nb\\t2\\n-args2-Chart type\\tbar]", + "eval.tests.test_debug_render.test_debug_chart_type_variants[a\\t1\\nb\\t2\\n-args3-Chart type\\tscatter]", + "eval.tests.test_debug_render.test_debug_color_hints_do_not_appear_in_report[gradient]", + "eval.tests.test_debug_render.test_debug_color_hints_do_not_appear_in_report[legacy-color]", + "eval.tests.test_debug_render.test_debug_date_format_name_hints_expand_layouts[ANSIC-Mon Jan _2 15:04:05 2006]", + "eval.tests.test_debug_render.test_debug_date_format_name_hints_expand_layouts[Kitchen-3:04PM]", + "eval.tests.test_debug_render.test_debug_date_format_name_hints_expand_layouts[RFC3339-2006-01-02T15:04:05Z07:00]", + "eval.tests.test_debug_render.test_debug_date_format_name_hints_expand_layouts[mysql-2006-01-02 15:04:05]", + "eval.tests.test_debug_render.test_debug_date_format_rendered_and_only_when_set", + "eval.tests.test_debug_render.test_debug_date_named_hint_reports_df_inference", + "eval.tests.test_debug_render.test_debug_date_text_not_matching_parse_falls_back_to_string", + "eval.tests.test_debug_render.test_debug_default_linear_scale", + "eval.tests.test_debug_render.test_debug_empty_dataset_error_line[args0-pie]", + "eval.tests.test_debug_render.test_debug_empty_dataset_error_line[args1-bar]", + "eval.tests.test_debug_render.test_debug_empty_dataset_error_line[args2-pie]", + "eval.tests.test_debug_render.test_debug_empty_dataset_error_line[args3-line]", + "eval.tests.test_debug_render.test_debug_empty_dataset_error_line[args4-scatter]", + "eval.tests.test_debug_render.test_debug_empty_dataset_with_chart_type_hint", + "eval.tests.test_debug_render.test_debug_line_defaults_to_string_plus_two_floats", + "eval.tests.test_debug_render.test_debug_logarithmic_scale", + "eval.tests.test_debug_render.test_debug_no_title_omits_title_line", + "eval.tests.test_debug_render.test_debug_raw_line_format_df_mismatch_yields_empty_dataset", + "eval.tests.test_debug_render.test_debug_raw_line_format_ff_two_floats", + "eval.tests.test_debug_render.test_debug_raw_line_format_sff_bypasses_inference", + "eval.tests.test_debug_render.test_debug_scatter_two_floats_no_strings", + "eval.tests.test_debug_render.test_debug_separator_variants[a 1\\nb 2\\n-hint1-[space]]", + "eval.tests.test_debug_render.test_debug_separator_variants[a,1\\nb,2\\n-hint2-[comma]]", + "eval.tests.test_debug_render.test_debug_separator_variants[a;1\\nb;2\\n-hint3-[semicolon]]", + "eval.tests.test_debug_render.test_debug_separator_variants[a\\t1\\nb\\t2\\n-hint0-[tab]]", + "eval.tests.test_debug_render.test_debug_single_float_bar_incompatible_format_error", + "eval.tests.test_debug_render.test_debug_single_float_no_hint_also_incompatible", + "eval.tests.test_debug_render.test_debug_single_unterminated_line_alone_is_dropped", + "eval.tests.test_debug_render.test_debug_string_frequency_collapses_to_current_other", + "eval.tests.test_debug_render.test_debug_string_frequency_orders_by_count_desc", + "eval.tests.test_debug_render.test_debug_string_frequency_ten_distinct_keeps_last", + "eval.tests.test_debug_render.test_debug_string_only_frequency_pie", + "eval.tests.test_debug_render.test_debug_string_only_never_errors_string_is_preprocessed", + "eval.tests.test_debug_render.test_debug_tab_separator_is_default", + "eval.tests.test_debug_render.test_debug_title_alone_omits_label_lines", + "eval.tests.test_debug_render.test_debug_title_axis_labels_rendered_when_set", + "eval.tests.test_debug_render.test_debug_trailing_line_without_newline_is_dropped", + "eval.tests.test_debug_render.test_debug_two_column_all_strings_is_preprocessed", + "eval.tests.test_debug_render.test_debug_two_floats_no_strings_resolves_to_scatter", + "eval.tests.test_debug_render.test_debug_whitespace_and_blank_lines_are_skipped", + "eval.tests.test_debug_render.test_help_flags_had_no_side_effect_on_debug_flag", + "eval.tests.test_debug_render.test_help_precedes_stdin_processing", + "eval.tests.test_debug_render.test_help_prints_usage_to_stdout_and_exits_1[--help]", + "eval.tests.test_debug_render.test_help_prints_usage_to_stdout_and_exits_1[-h]", + "eval.tests.test_debug_render.test_help_prints_usage_to_stdout_and_exits_1[help]", + "eval.tests.test_debug_render.test_non_debug_empty_input_still_prints_report_and_exits_zero", + "eval.tests.test_debug_render.test_non_debug_incompatible_format_still_prints_report", + "eval.tests.test_debug_render.test_raw_line_format_valid_chart_still_builds_temp_html", + "eval.tests.test_tmpfile.test_chart_creates_named_html_temp_file", + "eval.tests.test_tmpfile.test_chart_html_is_a_real_document", + "eval.tests.test_tmpfile.test_chart_path_emits_no_debug_report", + "eval.tests.test_tmpfile.test_chart_path_writes_file_before_open_failure", + "eval.tests.test_tmpfile.test_combined_zero_based_and_log_scale_chart_file", + "eval.tests.test_tmpfile.test_data_with_string_only_goes_through_pie_chart_file", + "eval.tests.test_tmpfile.test_date_bearing_dataset_builds_temp_html", + "eval.tests.test_tmpfile.test_each_chart_type_creates_a_file[1\\t2\\n3\\t4\\n-args2-scatter]", + "eval.tests.test_tmpfile.test_each_chart_type_creates_a_file[1\\t2\\n3\\t4\\n-args3-line]", + "eval.tests.test_tmpfile.test_each_chart_type_creates_a_file[2020-01-01\\t1\\n2020-01-02\\t2\\n-args4-line-date]", + "eval.tests.test_tmpfile.test_each_chart_type_creates_a_file[a\\t1\\nb\\t2\\n-args0-bar]", + "eval.tests.test_tmpfile.test_each_chart_type_creates_a_file[a\\t1\\nb\\t2\\n-args1-pie]", + "eval.tests.test_tmpfile.test_empty_dataset_creates_no_temp_file", + "eval.tests.test_tmpfile.test_explicit_pie_bar_conflict_last_hint_wins_chart_file", + "eval.tests.test_tmpfile.test_incompatible_dataset_creates_no_temp_file", + "eval.tests.test_tmpfile.test_invalid_tempdir_causes_temp_file_creation_fatal", + "eval.tests.test_tmpfile.test_invalid_tempdir_when_tmpdir_is_a_regular_file", + "eval.tests.test_tmpfile.test_log_scale_chart_still_builds_temp_html", + "eval.tests.test_tmpfile.test_non_default_separators_still_build_temp_html[a 1\\nb 2\\n-hint0]", + "eval.tests.test_tmpfile.test_non_default_separators_still_build_temp_html[a,1\\nb,2\\n-hint1]", + "eval.tests.test_tmpfile.test_non_default_separators_still_build_temp_html[a;1\\nb;2\\n-hint2]", + "eval.tests.test_tmpfile.test_open_failure_message_on_stderr", + "eval.tests.test_tmpfile.test_temp_html_contains_chart_title_meta", + "eval.tests.test_tmpfile.test_temp_html_has_no_title_when_flag_omitted", + "eval.tests.test_tmpfile.test_temp_html_written_to_tmpdir_not_cwd", + "eval.tests.test_tmpfile.test_three_float_dataset_builds_temp_html", + "eval.tests.test_tmpfile.test_two_float_column_dataset_builds_temp_html", + "eval.tests.test_tmpfile.test_two_runs_create_two_distinct_files", + "eval.tests.test_tmpfile.test_zero_based_flag_emits_begin_at_zero_in_html" + ] + } + }, + "commit": "3be5b2b8b13fec16afb881540ae835cb62a9b8c2", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9696022648485392, + "eval_clean_hashes": [ + "7a05721594befb9fb3adf311eaf31a47d40872d6f7e9e0f28fd3e5912f3ce411" + ], + "input_record": { + "commit": "3be5b2b8b13fec16afb881540ae835cb62a9b8c2", + "commits": 203, + "contributors": 4, + "difficulty": "easy", + "difficulty_code_lines": 4662, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 4662, + "difficulty_runtime_deps": 1, + "difficulty_score": 1.9696022648485392, + "difficulty_test_code_lines": 2994, + "full_name": "marianogappa/chart", + "github_stars": 549, + "input_joern_zip": "go_joern/marianogappa__chart.zip", + "joern_status": true, + "joern_time": 3.9573223700281233, + "language": "go", + "pb_match": [ + { + "pb_fullname": "sclevine/yj", + "rank": 429, + "similarity": 0.49932214617729187 + }, + { + "pb_fullname": "antonmedv/walk", + "rank": 553, + "similarity": 0.4832703471183777 + }, + { + "pb_fullname": "peco/peco", + "rank": 125, + "similarity": 0.5362725853919983 + }, + { + "pb_fullname": "mikefarah/yq", + "rank": 238, + "similarity": 0.5557358264923096 + }, + { + "pb_fullname": "johnkerl/miller", + "rank": 165, + "similarity": 0.5169025659561157 + }, + { + "pb_fullname": "JohannesKaufmann/html-to-markdown", + "rank": 289, + "similarity": 0.507575511932373 + }, + { + "pb_fullname": "alecthomas/chroma", + "rank": 460, + "similarity": 0.48917916417121887 + }, + { + "pb_fullname": "gabotechs/dep-tree", + "rank": 459, + "similarity": 0.5221021771430969 + }, + { + "pb_fullname": "FiloSottile/age", + "rank": 735, + "similarity": 0.45815685391426086 + }, + { + "pb_fullname": "boyter/scc", + "rank": 121, + "similarity": 0.5677700042724609 + }, + { + "pb_fullname": "rs/jplot", + "rank": 59, + "similarity": 0.5923510789871216 + }, + { + "pb_fullname": "multiprocessio/dsq", + "rank": 620, + "similarity": 0.4746380150318146 + }, + { + "pb_fullname": "noborus/trdsql", + "rank": 299, + "similarity": 0.5258879661560059 + }, + { + "pb_fullname": "noborus/ov", + "rank": 249, + "similarity": 0.5466188788414001 + }, + { + "pb_fullname": "sibprogrammer/xq", + "rank": 342, + "similarity": 0.5085127949714661 + }, + { + "pb_fullname": "sheepla/pingu", + "rank": 375, + "similarity": 0.5054174661636353 + }, + { + "pb_fullname": "raviqqe/muffet", + "rank": 972, + "similarity": 0.4550681710243225 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 189, + "similarity": 0.5521209239959717 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 73, + "similarity": 0.5453298091888428 + }, + { + "pb_fullname": "cheat/cheat", + "rank": 511, + "similarity": 0.5109773874282837 + }, + { + "pb_fullname": "antonmedv/fx", + "rank": 51, + "similarity": 0.5730421543121338 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 75, + "similarity": 0.575993537902832 + }, + { + "pb_fullname": "tomnomnom/gron", + "rank": 691, + "similarity": 0.48191842436790466 + }, + { + "pb_fullname": "junegunn/fzf", + "rank": 192, + "similarity": 0.5153278708457947 + } + ], + "repo_age": 9.96, + "repo_path": "go/marianogappa__chart", + "source": "commit:3be5b2b8b13fec16afb881540ae835cb62a9b8c2", + "status": "done", + "url": "https://github.com/marianogappa/chart" + }, + "instance_id": "marianogappa__chart.3be5b2b", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 1, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "marianogappa/chart" +} diff --git a/marianogappa--chart.3be5b2b/tests/test.sh b/marianogappa--chart.3be5b2b/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/marianogappa--chart.3be5b2b/tests/workspace.tar.gz b/marianogappa--chart.3be5b2b/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7d2a5f713294fba4e6bb1171a37956954b0c5ba2 --- /dev/null +++ b/marianogappa--chart.3be5b2b/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9dcfc4ac4f8155d87be7dc066dc573c2c1c91e3532aefa25f0af93cdceaa351 +size 2940 diff --git a/mario-eth--soldeer.e4aac28/environment/Dockerfile b/mario-eth--soldeer.e4aac28/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mario-eth--soldeer.e4aac28/environment/download.sh b/mario-eth--soldeer.e4aac28/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e1ab2f97d5024429e2ea842cc5774c5331cbb5da --- /dev/null +++ b/mario-eth--soldeer.e4aac28/environment/download.sh @@ -0,0 +1,3977 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym offline-build dependency prefetch for soldeer (Rust workspace). +# +# This is a STANDALONE script: it is sourced (`source /source_ro/download.sh`) in a networked +# container before the repository source tree is copied into /workspace/source. It must not read +# any repository file (Cargo.toml, Cargo.lock, ...). All dependency information is embedded inline. +# +# It only prefetches Cargo dependencies into the local cargo registry cache and exports the +# variables build.sh relies on. It performs NO compilation, linking, testing, or packaging. + +# Fail loudly on any error when it is safe to do so, and never mask failures or stderr. +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + set -u +else + set -eu +fi + +# The cargo registry cache created here persists into the offline build container under $HOME/.cargo. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" + +# Temporary standalone workspace for prefetch; never under the repository. +_pb_tmp="$(mktemp -d)" +mkdir -p "$_pb_tmp/crates/cli/src" +mkdir -p "$_pb_tmp/crates/commands/src" +mkdir -p "$_pb_tmp/crates/core/src" + +# --------------------------------------------------------------------------- +# Workspace manifest (reproduced from the repository, all data inline). +# --------------------------------------------------------------------------- +cat > "$_pb_tmp/Cargo.toml" <<'PBEOF' +[workspace] +members = ["crates/cli", "crates/core", "crates/commands"] +resolver = "2" + +[workspace.package] +authors = ["m4rio"] +categories = ["development-tools"] +description = "A minimal Solidity package manager written in Rust, best used with Foundry" +edition = "2024" +exclude = ["tests/"] +homepage = "https://soldeer.xyz" +keywords = ["solidity", "package-manager", "foundry"] +license = "MIT" +readme = "./README.md" +repository = "https://github.com/mario-eth/soldeer" +rust-version = "1.88" +version = "0.11.0" + +[workspace.lints.clippy] +dbg-macro = "warn" +manual-string-new = "warn" +uninlined-format-args = "warn" +use-self = "warn" +redundant-clone = "warn" +unwrap_used = "warn" + +[workspace.lints.rust] +rust-2018-idioms = "warn" +unreachable-pub = "warn" +unused-must-use = "warn" +redundant-lifetimes = "warn" + +[workspace.dependencies] +bon = "3.0.0" +clap = { version = "4.5.9", features = ["derive"] } +cliclack = "0.5.4" +derive_more = { version = "2.0.1", features = ["from", "display", "from_str"] } +log = { version = "0.4.25", features = ["kv"] } +mockito = "1.5.0" +path-slash = "0.2.1" +rayon = "1.10.0" +reqwest = "0.13.2" +temp-env = { version = "0.3.6", features = ["async_closure"] } +testdir = "0.10.0" +thiserror = "2.0.3" +tokio = { version = "1.38.0", features = [ + "io-util", + "macros", + "process", + "rt-multi-thread", +] } +PBEOF + +cat > "$_pb_tmp/crates/cli/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer" +description.workspace = true +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[[bin]] +name = "soldeer" +path = "src/main.rs" + +[dependencies] +env_logger = { version = "0.11.9", features = ["unstable-kv"] } +log.workspace = true +soldeer-commands = { path = "../commands", version = "0.11.0" } +tokio.workspace = true +yansi = { version = "1.0.1", features = ["detect-tty", "detect-env"] } +PBEOF + +cat > "$_pb_tmp/crates/commands/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer-commands" +description = "High-level commands for the Soldeer CLI" +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[lints] +workspace = true + +[dependencies] +bon.workspace = true +clap.workspace = true +clap-verbosity-flag = "3.0.2" +cliclack.workspace = true +derive_more.workspace = true +email-address-parser = "2.0.0" +path-slash.workspace = true +rayon.workspace = true +soldeer-core = { path = "../core", version = "0.11.0" } +tokio.workspace = true + +[dev-dependencies] +mockito.workspace = true +reqwest.workspace = true +temp-env.workspace = true +testdir.workspace = true + +[features] +serde = ["soldeer-core/serde"] +PBEOF + +cat > "$_pb_tmp/crates/core/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer-core" +description = "Core functionality for Soldeer" +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[lints] +workspace = true + +[dependencies] +bon.workspace = true +chrono = { version = "0.4.38", default-features = false, features = [ + "serde", + "std", +] } +const-hex = "1.12.0" +derive_more.workspace = true +dunce = "1.0.5" +home = "0.5.9" +ignore = { version = "0.4.24", features = ["simd-accel"] } +log = { workspace = true, features = ["kv_std"] } +path-slash.workspace = true +rayon.workspace = true +regex = "1.10.5" +reqwest = { workspace = true, features = ["json", "multipart", "stream"] } +sanitize-filename = "0.6.0" +semver = "1.0.23" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" +sha2 = "0.10.8" +thiserror.workspace = true +tokio.workspace = true +toml_edit = { version = "0.25.11", features = ["serde"] } +uuid = { version = "1.10.0", features = ["serde", "v4"] } +zip = { version = "4.0.0", default-features = false, features = ["deflate"] } +zip-extract = { version = "0.4.0", default-features = false, features = [ + "deflate", +] } + +[dev-dependencies] +mockito.workspace = true +temp-env.workspace = true +testdir.workspace = true + +[features] +serde = [] +PBEOF + +# Stub source files so cargo fetch can resolve the declared [lib]/[[bin]] paths. +printf 'fn main() {}\n' > "$_pb_tmp/crates/cli/src/main.rs" +printf 'pub fn stub() {}\n' > "$_pb_tmp/crates/commands/src/lib.rs" +printf 'pub fn stub() {}\n' > "$_pb_tmp/crates/core/src/lib.rs" + +# --------------------------------------------------------------------------- +# Embedded Cargo.lock (reproduced verbatim from the repository). Pins the exact +# dependency set so the offline build finds every crate already in the cache. +# --------------------------------------------------------------------------- +cat > "$_pb_tmp/Cargo.lock" <<'PB_LOCK_EOF' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-rs" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bon" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47dbe92550676ee653353c310dfb9cf6ba17ee70396e1f7cf0a2020ad49b2fe" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c" +dependencies = [ + "darling", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "bstr" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "cargo_metadata" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cc" +version = "1.2.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap-verbosity-flag" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" +dependencies = [ + "clap", + "log", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cliclack" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4529f45438fc25ca048b242d5c48e2d3ce9a521e2a5a9123d9737d8520b030dd" +dependencies = [ + "console", + "indicatif", + "once_cell", + "strsim", + "textwrap", + "zeroize", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "colored" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "const-hex" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "email-address-parser" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e981c3b50d728bb498dd0f860a7228ef17e19efef5cc2c6e30d78ebce13bcaa7" +dependencies = [ + "console_error_panic_hook", + "pest", + "pest_derive", + "quick-xml", + "wasm-bindgen", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "miniz_oxide", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "globset" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "indicatif" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" +dependencies = [ + "console", + "portable-atomic", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jiff" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.185" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +dependencies = [ + "value-bag", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "mockito" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90820618712cab19cfc46b274c6c22546a82affcb3c3bdf0f29e3db8e1bb92c0" +dependencies = [ + "assert-json-diff", + "bytes", + "colored", + "futures-core", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "log", + "pin-project-lite", + "rand", + "regex", + "serde_json", + "serde_urlencoded", + "similar", + "tokio", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" +dependencies = [ + "libc", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "objc2-core-foundation", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bitflags", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "unarray", +] + +[[package]] +name = "quick-xml" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +dependencies = [ + "memchr", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sanitize-filename" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" +dependencies = [ + "regex", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_fmt" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e497af288b3b95d067a23a4f749f2861121ffcb2f6d8379310dcda040c345ed" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "soldeer" +version = "0.11.0" +dependencies = [ + "env_logger", + "log", + "soldeer-commands", + "tokio", + "yansi", +] + +[[package]] +name = "soldeer-commands" +version = "0.11.0" +dependencies = [ + "bon", + "clap", + "clap-verbosity-flag", + "cliclack", + "derive_more", + "email-address-parser", + "mockito", + "path-slash", + "rayon", + "reqwest", + "soldeer-core", + "temp-env", + "testdir", + "tokio", +] + +[[package]] +name = "soldeer-core" +version = "0.11.0" +dependencies = [ + "bon", + "chrono", + "const-hex", + "derive_more", + "dunce", + "home", + "ignore", + "log", + "mockito", + "path-slash", + "rayon", + "regex", + "reqwest", + "sanitize-filename", + "semver", + "serde", + "serde_json", + "sha2", + "temp-env", + "testdir", + "thiserror 2.0.18", + "tokio", + "toml_edit", + "uuid", + "zip", + "zip-extract", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "sval" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb9318255ebd817902d7e279d8f8e39b35b1b9954decd5eb9ea0e30e5fd2b6a" + +[[package]] +name = "sval_buffer" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12571299185e653fdb0fbfe36cd7f6529d39d4e747a60b15a3f34574b7b97c61" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39526f24e997706c0de7f03fb7371f7f5638b66a504ded508e20ad173d0a3677" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dd3bb26965d682280fcc49400ac2a05036f4ee1e6dbd61bf8402d5a5c3a54" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0cda08f6d5c9948024a6551077557b1fdcc3880ff2f20ae839667d2ec2d87ed" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d49d5e6c1f9fd0e53515819b03a97ca4eb1bff5c8ee097c43391c09ecfb19f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f876c5a78405375b4e19cbb9554407513b59c93dea12dc6a4af4e1d30899ca" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9ccd3b7f7200239a655e517dd3fd48d960b9111ad24bd6a5e055bef17607c7" +dependencies = [ + "serde_core", + "sval", + "sval_nested", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sysinfo" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ab6a2f8bfe508deb3c6406578252e491d299cbbf3bc0529ecc3313aee4a52f" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "windows", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "temp-env" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96374855068f47402c3121c6eed88d29cb1de8f3ab27090e273e420bdabcf050" +dependencies = [ + "futures", + "parking_lot", +] + +[[package]] +name = "testdir" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d53c48916d4a8bb476f45e3699d9d904477dcd3569117d446f1b870d1e5a576" +dependencies = [ + "anyhow", + "backtrace", + "cargo-platform", + "cargo_metadata", + "fslock", + "sysinfo", + "whoami", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91135f59b1cbf38c91e73cf3386fca9bb77915c45ce2771460c9d92f0f3d776" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "value-bag" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16530907bfe2999a1773ca5900a65101e092c70f642f25cc23ca0c43573262c5" +dependencies = [ + "erased-serde", + "serde_core", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d00ae130edd690eaa877e4f40605d534790d1cf1d651e7685bd6a144521b251f" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasite" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42" +dependencies = [ + "wasi 0.14.7+wasi-0.2.4", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "whoami" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6a5b12f9df4f978d2cfdb1bd3bac52433f44393342d7ee9c25f5a1c14c0f45d" +dependencies = [ + "libc", + "libredox", + "objc2-system-configuration", + "wasite", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zip" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1" +dependencies = [ + "arbitrary", + "crc32fast", + "flate2", + "indexmap", + "memchr", + "zopfli", +] + +[[package]] +name = "zip-extract" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fa5b9958fd0b5b685af54f2c3fa21fca05fe295ebaf3e77b6d24d96c4174037" +dependencies = [ + "log", + "thiserror 2.0.18", + "zip", +] + +[[package]] +name = "zlib-rs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] +PB_LOCK_EOF + +# --------------------------------------------------------------------------- +# Prefetch every dependency into $CARGO_HOME/registry. This is network-only and +# compiles nothing. --manifest-path points strictly at the generated temp file. +# --------------------------------------------------------------------------- +if cargo fetch --manifest-path "$_pb_tmp/Cargo.toml"; then + : # dependency prefetch succeeded +else + echo "download.sh: cargo fetch failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# build.sh reuses the prefetched registry cache and builds the real repo offline. diff --git a/mario-eth--soldeer.e4aac28/environment/executable b/mario-eth--soldeer.e4aac28/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..1cc23319e66c4cba6625fb11ee14f0d26f248b7a --- /dev/null +++ b/mario-eth--soldeer.e4aac28/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3ae1a13faf26035e82419cda069ef257be2170460e055760f33e13837f50310 +size 17350880 diff --git a/mario-eth--soldeer.e4aac28/environment/harbor_prepare_download_env.sh b/mario-eth--soldeer.e4aac28/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mario-eth--soldeer.e4aac28/environment/workspace.tar.gz b/mario-eth--soldeer.e4aac28/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..930dbd54914e8d4bae3dba64c51a11a7d28a481f --- /dev/null +++ b/mario-eth--soldeer.e4aac28/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6ed6328ce7edaa45857a9b4c73892ae75db643469ec5927eb354ff90853736a +size 48495 diff --git a/mario-eth--soldeer.e4aac28/instruction.md b/mario-eth--soldeer.e4aac28/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mario-eth--soldeer.e4aac28/solution/solve.sh b/mario-eth--soldeer.e4aac28/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mario-eth--soldeer.e4aac28/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mario-eth--soldeer.e4aac28/task.toml b/mario-eth--soldeer.e4aac28/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..282f00cc119bca51a215932571fdc20b3575799b --- /dev/null +++ b/mario-eth--soldeer.e4aac28/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mario-eth--soldeer.e4aac28" +description = "Synthetic ProgramGym cleanroom reconstruction task for mario-eth/soldeer" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "mario-eth__soldeer.e4aac28" +repository = "mario-eth/soldeer" +commit = "e4aac28659531229105c756d8f76c2afad16d924" +language = "rust" +difficulty = "easy" +difficulty_score = 1.943593432768369 +test_branches = 4 +test_count = 271 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mario-eth--soldeer.e4aac28/tests/Dockerfile b/mario-eth--soldeer.e4aac28/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_01.tar.gz b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7827f54636c99d8725282a1fe0f395c8d8c27af9 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7e73517aee38ba0b6ed9912eee05ead5de521d3e4c80945379ff48214bce885 +size 173829242 diff --git a/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_02.tar.gz b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..afca4fcb019c63db09c8a88ae85d767492663487 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c621a8efc0f85fdf16cda81d409237be8d90141a0106b23f206ddddf32d88d37 +size 145167 diff --git a/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_03.tar.gz b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1768fd8104b66f9b5c5be206aa18227aab944203 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac344d6b493e33c03cdfe38ca42b5ad7c7c65df7e8c0a809aa70417f9cc012dc +size 8643 diff --git a/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_04.tar.gz b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9351d1671349a7745b7691730d8c9793d9e45a56 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:302144138b7fce01907a3a19913c8c05617ca8e5dc27ed685c5f2137421fe514 +size 19531 diff --git a/mario-eth--soldeer.e4aac28/tests/download.sh b/mario-eth--soldeer.e4aac28/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..e1ab2f97d5024429e2ea842cc5774c5331cbb5da --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/download.sh @@ -0,0 +1,3977 @@ +#!/usr/bin/env bash +# download.sh - ProgramGym offline-build dependency prefetch for soldeer (Rust workspace). +# +# This is a STANDALONE script: it is sourced (`source /source_ro/download.sh`) in a networked +# container before the repository source tree is copied into /workspace/source. It must not read +# any repository file (Cargo.toml, Cargo.lock, ...). All dependency information is embedded inline. +# +# It only prefetches Cargo dependencies into the local cargo registry cache and exports the +# variables build.sh relies on. It performs NO compilation, linking, testing, or packaging. + +# Fail loudly on any error when it is safe to do so, and never mask failures or stderr. +if [ "${BASH_SOURCE[0]}" != "$0" ]; then + set -u +else + set -eu +fi + +# The cargo registry cache created here persists into the offline build container under $HOME/.cargo. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" + +# Temporary standalone workspace for prefetch; never under the repository. +_pb_tmp="$(mktemp -d)" +mkdir -p "$_pb_tmp/crates/cli/src" +mkdir -p "$_pb_tmp/crates/commands/src" +mkdir -p "$_pb_tmp/crates/core/src" + +# --------------------------------------------------------------------------- +# Workspace manifest (reproduced from the repository, all data inline). +# --------------------------------------------------------------------------- +cat > "$_pb_tmp/Cargo.toml" <<'PBEOF' +[workspace] +members = ["crates/cli", "crates/core", "crates/commands"] +resolver = "2" + +[workspace.package] +authors = ["m4rio"] +categories = ["development-tools"] +description = "A minimal Solidity package manager written in Rust, best used with Foundry" +edition = "2024" +exclude = ["tests/"] +homepage = "https://soldeer.xyz" +keywords = ["solidity", "package-manager", "foundry"] +license = "MIT" +readme = "./README.md" +repository = "https://github.com/mario-eth/soldeer" +rust-version = "1.88" +version = "0.11.0" + +[workspace.lints.clippy] +dbg-macro = "warn" +manual-string-new = "warn" +uninlined-format-args = "warn" +use-self = "warn" +redundant-clone = "warn" +unwrap_used = "warn" + +[workspace.lints.rust] +rust-2018-idioms = "warn" +unreachable-pub = "warn" +unused-must-use = "warn" +redundant-lifetimes = "warn" + +[workspace.dependencies] +bon = "3.0.0" +clap = { version = "4.5.9", features = ["derive"] } +cliclack = "0.5.4" +derive_more = { version = "2.0.1", features = ["from", "display", "from_str"] } +log = { version = "0.4.25", features = ["kv"] } +mockito = "1.5.0" +path-slash = "0.2.1" +rayon = "1.10.0" +reqwest = "0.13.2" +temp-env = { version = "0.3.6", features = ["async_closure"] } +testdir = "0.10.0" +thiserror = "2.0.3" +tokio = { version = "1.38.0", features = [ + "io-util", + "macros", + "process", + "rt-multi-thread", +] } +PBEOF + +cat > "$_pb_tmp/crates/cli/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer" +description.workspace = true +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[[bin]] +name = "soldeer" +path = "src/main.rs" + +[dependencies] +env_logger = { version = "0.11.9", features = ["unstable-kv"] } +log.workspace = true +soldeer-commands = { path = "../commands", version = "0.11.0" } +tokio.workspace = true +yansi = { version = "1.0.1", features = ["detect-tty", "detect-env"] } +PBEOF + +cat > "$_pb_tmp/crates/commands/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer-commands" +description = "High-level commands for the Soldeer CLI" +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[lints] +workspace = true + +[dependencies] +bon.workspace = true +clap.workspace = true +clap-verbosity-flag = "3.0.2" +cliclack.workspace = true +derive_more.workspace = true +email-address-parser = "2.0.0" +path-slash.workspace = true +rayon.workspace = true +soldeer-core = { path = "../core", version = "0.11.0" } +tokio.workspace = true + +[dev-dependencies] +mockito.workspace = true +reqwest.workspace = true +temp-env.workspace = true +testdir.workspace = true + +[features] +serde = ["soldeer-core/serde"] +PBEOF + +cat > "$_pb_tmp/crates/core/Cargo.toml" <<'PBEOF' +[package] +name = "soldeer-core" +description = "Core functionality for Soldeer" +authors.workspace = true +categories.workspace = true +edition.workspace = true +exclude.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[lints] +workspace = true + +[dependencies] +bon.workspace = true +chrono = { version = "0.4.38", default-features = false, features = [ + "serde", + "std", +] } +const-hex = "1.12.0" +derive_more.workspace = true +dunce = "1.0.5" +home = "0.5.9" +ignore = { version = "0.4.24", features = ["simd-accel"] } +log = { workspace = true, features = ["kv_std"] } +path-slash.workspace = true +rayon.workspace = true +regex = "1.10.5" +reqwest = { workspace = true, features = ["json", "multipart", "stream"] } +sanitize-filename = "0.6.0" +semver = "1.0.23" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" +sha2 = "0.10.8" +thiserror.workspace = true +tokio.workspace = true +toml_edit = { version = "0.25.11", features = ["serde"] } +uuid = { version = "1.10.0", features = ["serde", "v4"] } +zip = { version = "4.0.0", default-features = false, features = ["deflate"] } +zip-extract = { version = "0.4.0", default-features = false, features = [ + "deflate", +] } + +[dev-dependencies] +mockito.workspace = true +temp-env.workspace = true +testdir.workspace = true + +[features] +serde = [] +PBEOF + +# Stub source files so cargo fetch can resolve the declared [lib]/[[bin]] paths. +printf 'fn main() {}\n' > "$_pb_tmp/crates/cli/src/main.rs" +printf 'pub fn stub() {}\n' > "$_pb_tmp/crates/commands/src/lib.rs" +printf 'pub fn stub() {}\n' > "$_pb_tmp/crates/core/src/lib.rs" + +# --------------------------------------------------------------------------- +# Embedded Cargo.lock (reproduced verbatim from the repository). Pins the exact +# dependency set so the offline build finds every crate already in the cache. +# --------------------------------------------------------------------------- +cat > "$_pb_tmp/Cargo.lock" <<'PB_LOCK_EOF' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-rs" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bon" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f47dbe92550676ee653353c310dfb9cf6ba17ee70396e1f7cf0a2020ad49b2fe" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519bd3116aeeb42d5372c29d982d16d0170d3d4a5ed85fc7dd91642ffff3c67c" +dependencies = [ + "darling", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "bstr" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "cargo_metadata" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + +[[package]] +name = "cc" +version = "1.2.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap-verbosity-flag" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d92b1fab272fe943881b77cc6e920d6543e5b1bfadbd5ed81c7c5a755742394" +dependencies = [ + "clap", + "log", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cliclack" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4529f45438fc25ca048b242d5c48e2d3ce9a521e2a5a9123d9737d8520b030dd" +dependencies = [ + "console", + "indicatif", + "once_cell", + "strsim", + "textwrap", + "zeroize", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "colored" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "const-hex" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531185e432bb31db1ecda541e9e7ab21468d4d844ad7505e0546a49b4945d49b" +dependencies = [ + "cfg-if", + "cpufeatures", + "proptest", + "serde_core", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "email-address-parser" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e981c3b50d728bb498dd0f860a7228ef17e19efef5cc2c6e30d78ebce13bcaa7" +dependencies = [ + "console_error_panic_hook", + "pest", + "pest_derive", + "quick-xml", + "wasm-bindgen", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "miniz_oxide", + "zlib-rs", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "globset" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "indicatif" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25470f23803092da7d239834776d653104d551bc4d7eacaf31e6837854b8e9eb" +dependencies = [ + "console", + "portable-atomic", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jiff" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.185" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +dependencies = [ + "value-bag", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", +] + +[[package]] +name = "mockito" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90820618712cab19cfc46b274c6c22546a82affcb3c3bdf0f29e3db8e1bb92c0" +dependencies = [ + "assert-json-diff", + "bytes", + "colored", + "futures-core", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "log", + "pin-project-lite", + "rand", + "regex", + "serde_json", + "serde_urlencoded", + "similar", + "tokio", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" +dependencies = [ + "libc", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "objc2-core-foundation", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bitflags", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "unarray", +] + +[[package]] +name = "quick-xml" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +dependencies = [ + "memchr", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sanitize-filename" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" +dependencies = [ + "regex", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_fmt" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e497af288b3b95d067a23a4f749f2861121ffcb2f6d8379310dcda040c345ed" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "soldeer" +version = "0.11.0" +dependencies = [ + "env_logger", + "log", + "soldeer-commands", + "tokio", + "yansi", +] + +[[package]] +name = "soldeer-commands" +version = "0.11.0" +dependencies = [ + "bon", + "clap", + "clap-verbosity-flag", + "cliclack", + "derive_more", + "email-address-parser", + "mockito", + "path-slash", + "rayon", + "reqwest", + "soldeer-core", + "temp-env", + "testdir", + "tokio", +] + +[[package]] +name = "soldeer-core" +version = "0.11.0" +dependencies = [ + "bon", + "chrono", + "const-hex", + "derive_more", + "dunce", + "home", + "ignore", + "log", + "mockito", + "path-slash", + "rayon", + "regex", + "reqwest", + "sanitize-filename", + "semver", + "serde", + "serde_json", + "sha2", + "temp-env", + "testdir", + "thiserror 2.0.18", + "tokio", + "toml_edit", + "uuid", + "zip", + "zip-extract", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "sval" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb9318255ebd817902d7e279d8f8e39b35b1b9954decd5eb9ea0e30e5fd2b6a" + +[[package]] +name = "sval_buffer" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12571299185e653fdb0fbfe36cd7f6529d39d4e747a60b15a3f34574b7b97c61" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39526f24e997706c0de7f03fb7371f7f5638b66a504ded508e20ad173d0a3677" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dd3bb26965d682280fcc49400ac2a05036f4ee1e6dbd61bf8402d5a5c3a54" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0cda08f6d5c9948024a6551077557b1fdcc3880ff2f20ae839667d2ec2d87ed" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d49d5e6c1f9fd0e53515819b03a97ca4eb1bff5c8ee097c43391c09ecfb19f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f876c5a78405375b4e19cbb9554407513b59c93dea12dc6a4af4e1d30899ca" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9ccd3b7f7200239a655e517dd3fd48d960b9111ad24bd6a5e055bef17607c7" +dependencies = [ + "serde_core", + "sval", + "sval_nested", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sysinfo" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ab6a2f8bfe508deb3c6406578252e491d299cbbf3bc0529ecc3313aee4a52f" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "windows", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "temp-env" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96374855068f47402c3121c6eed88d29cb1de8f3ab27090e273e420bdabcf050" +dependencies = [ + "futures", + "parking_lot", +] + +[[package]] +name = "testdir" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d53c48916d4a8bb476f45e3699d9d904477dcd3569117d446f1b870d1e5a576" +dependencies = [ + "anyhow", + "backtrace", + "cargo-platform", + "cargo_metadata", + "fslock", + "sysinfo", + "whoami", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91135f59b1cbf38c91e73cf3386fca9bb77915c45ce2771460c9d92f0f3d776" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "value-bag" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16530907bfe2999a1773ca5900a65101e092c70f642f25cc23ca0c43573262c5" +dependencies = [ + "erased-serde", + "serde_core", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d00ae130edd690eaa877e4f40605d534790d1cf1d651e7685bd6a144521b251f" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasite" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42" +dependencies = [ + "wasi 0.14.7+wasi-0.2.4", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "whoami" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6a5b12f9df4f978d2cfdb1bd3bac52433f44393342d7ee9c25f5a1c14c0f45d" +dependencies = [ + "libc", + "libredox", + "objc2-system-configuration", + "wasite", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zip" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1" +dependencies = [ + "arbitrary", + "crc32fast", + "flate2", + "indexmap", + "memchr", + "zopfli", +] + +[[package]] +name = "zip-extract" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fa5b9958fd0b5b685af54f2c3fa21fca05fe295ebaf3e77b6d24d96c4174037" +dependencies = [ + "log", + "thiserror 2.0.18", + "zip", +] + +[[package]] +name = "zlib-rs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] +PB_LOCK_EOF + +# --------------------------------------------------------------------------- +# Prefetch every dependency into $CARGO_HOME/registry. This is network-only and +# compiles nothing. --manifest-path points strictly at the generated temp file. +# --------------------------------------------------------------------------- +if cargo fetch --manifest-path "$_pb_tmp/Cargo.toml"; then + : # dependency prefetch succeeded +else + echo "download.sh: cargo fetch failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# build.sh reuses the prefetched registry cache and builds the real repo offline. diff --git a/mario-eth--soldeer.e4aac28/tests/executable b/mario-eth--soldeer.e4aac28/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..1cc23319e66c4cba6625fb11ee14f0d26f248b7a --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3ae1a13faf26035e82419cda069ef257be2170460e055760f33e13837f50310 +size 17350880 diff --git a/mario-eth--soldeer.e4aac28/tests/harbor_prepare_download_env.sh b/mario-eth--soldeer.e4aac28/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mario-eth--soldeer.e4aac28/tests/programgym_evaluator.py b/mario-eth--soldeer.e4aac28/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mario-eth--soldeer.e4aac28/tests/programgym_task.json b/mario-eth--soldeer.e4aac28/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..8131794221fa670e16aaa1c70acf6c18ec412f72 --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/programgym_task.json @@ -0,0 +1,2404 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_dispatch.test_command_dispatch_prints_intro[push-args6-\\U0001f98c Soldeer Push \\U0001f98c]", + "reasons": [ + { + "detail": "subprocess.TimeoutExpired: Command '['/opt/programgym/artifacts/rust-llvm-cov/runtime/executable', 'push', 'mypkg~0.1.0']' timed out after 90 seconds", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[push-args6]", + "reasons": [ + { + "detail": "subprocess.TimeoutExpired: Command '['/opt/programgym/artifacts/rust-llvm-cov/runtime/executable', 'push', 'mypkg~0.1.0']' timed out after 90 seconds", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_dispatch.test_push_dispatch_accepts_dependency", + "reasons": [ + { + "detail": "subprocess.TimeoutExpired: Command '['/opt/programgym/artifacts/rust-llvm-cov/runtime/executable', 'push', 'mypkg~0.5.0']' timed out after 90 seconds", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_config_location_invalid_full_error_golden", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_bad_dependency_full_error_golden", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_branch_requires_git", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_git_conflicts_with_url_after", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_git_requires_dependency", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_rev_conflicts_with_branch", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_rev_conflicts_with_tag", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_rev_requires_git", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_tag_conflicts_with_branch", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_tag_requires_git", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_url_conflicts_with_git", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_install_url_requires_dependency", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_login_email_conflicts_with_token", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_login_password_conflicts_with_token", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_push_rejects_two_versions", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_push_requires_dependency", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_uninstall_rejects_config_location_flag", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_uninstall_requires_dependency", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_parser_validation.test_unknown_flag_for_init_rejected", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_parser_validation.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity2-None]", + "reasons": [ + { + "detail": "assert '[2026-09-10T...ppings.txt\"\\n' == '' + [2026-09-10T13:13:34Z DEBUG soldeer_core::config] SOLDEER_PROJECT_ROOT not defined, searching for project root + [2026-09-10T13:13:34Z DEBUG soldeer_core:", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_progress.test_tui_enabled_init_prints_intro_and_progress", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_progress.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_version_banner.test_push_banner_exact", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_version_banner.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_version_banner.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_version_banner.test_uninstall_banner_exact", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_version_banner.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_version_banner.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_version_banner.test_version_subcommand_prints_banner_then_version", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_version_banner.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[clean-args4-\\U0001f98c Soldeer Clean \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[init-args0-\\U0001f98c Soldeer Init \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[install-args1-\\U0001f98c Soldeer Install \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[login-args3-\\U0001f98c Soldeer Login \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[push-args6-\\U0001f98c Soldeer Push \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[uninstall-args5-\\U0001f98c Soldeer Uninstall \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatch_prints_intro[update-args2-\\U0001f98c Soldeer Update \\U0001f98c]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[clean-args4]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[init-args0]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[install-args1]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[login-args3]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[push-args6]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[uninstall-args5]", + "eval.tests.test_dispatch.test_command_dispatches_with_banner_regardless_of_later_error[update-args2]", + "eval.tests.test_dispatch.test_init_dispatch_step_is_printed", + "eval.tests.test_dispatch.test_login_dispatch_deprecation_warning", + "eval.tests.test_dispatch.test_push_dispatch_accepts_dependency", + "eval.tests.test_dispatch.test_uninstall_dispatch_accepts_dependency", + "eval.tests.test_dispatch.test_version_subcommand_reaches_dispatch", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[clean]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[init]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[install]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[login]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[push]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[uninstall]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[update]", + "eval.tests.test_help.test_help_subcommand_form_matches_golden[version]", + "eval.tests.test_help.test_help_subcommand_matches_golden", + "eval.tests.test_help.test_long_help_matches_golden", + "eval.tests.test_help.test_no_args_prints_help_to_stderr_exit_two", + "eval.tests.test_help.test_short_help_matches_golden", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[clean]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[init]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[install]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[login]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[push]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[uninstall]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[update]", + "eval.tests.test_help.test_subcommand_long_help_matches_golden[version]", + "eval.tests.test_help.test_unknown_subcommand_error_matches_golden", + "eval.tests.test_parser_validation.test_config_location_foundry_reaches_dispatch", + "eval.tests.test_parser_validation.test_config_location_invalid_full_error_golden", + "eval.tests.test_parser_validation.test_config_location_on_install_accepted", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[1]", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[FOUNDRY]", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[Soldeer]", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[bogus]", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[foundry-soldeer]", + "eval.tests.test_parser_validation.test_config_location_rejects_invalid_value[foundryt]", + "eval.tests.test_parser_validation.test_config_location_soldeer_reaches_dispatch", + "eval.tests.test_parser_validation.test_install_accepts_valid_dependency_shape[a~b]", + "eval.tests.test_parser_validation.test_install_accepts_valid_dependency_shape[mypkg~1.2.3]", + "eval.tests.test_parser_validation.test_install_accepts_valid_dependency_shape[synthetic-pkg~0.0.1]", + "eval.tests.test_parser_validation.test_install_bad_dependency_full_error_golden", + "eval.tests.test_parser_validation.test_install_branch_plus_git_reaches_dispatch", + "eval.tests.test_parser_validation.test_install_branch_requires_git", + "eval.tests.test_parser_validation.test_install_clean_flag_accepted", + "eval.tests.test_parser_validation.test_install_git_conflicts_with_url_after", + "eval.tests.test_parser_validation.test_install_git_requires_dependency", + "eval.tests.test_parser_validation.test_install_recursive_deps_flag_accepted[--recursive-deps]", + "eval.tests.test_parser_validation.test_install_recursive_deps_flag_accepted[-d]", + "eval.tests.test_parser_validation.test_install_regenerate_flag_accepted[--regenerate-remappings]", + "eval.tests.test_parser_validation.test_install_regenerate_flag_accepted[-g]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_with_multiple_tildes[a~b~c]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_with_multiple_tildes[one~two~three]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_with_multiple_tildes[x~y~z]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_without_tilde[a1b2]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_without_tilde[justletters]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_without_tilde[mydep]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_without_tilde[two-parts-without-tilde]", + "eval.tests.test_parser_validation.test_install_rejects_dependency_without_tilde[x]", + "eval.tests.test_parser_validation.test_install_rev_conflicts_with_branch", + "eval.tests.test_parser_validation.test_install_rev_conflicts_with_tag", + "eval.tests.test_parser_validation.test_install_rev_plus_git_reaches_dispatch", + "eval.tests.test_parser_validation.test_install_rev_requires_git", + "eval.tests.test_parser_validation.test_install_tag_conflicts_with_branch", + "eval.tests.test_parser_validation.test_install_tag_plus_git_reaches_dispatch", + "eval.tests.test_parser_validation.test_install_tag_requires_git", + "eval.tests.test_parser_validation.test_install_url_conflicts_with_git", + "eval.tests.test_parser_validation.test_install_url_requires_dependency", + "eval.tests.test_parser_validation.test_login_email_conflicts_with_token", + "eval.tests.test_parser_validation.test_login_password_conflicts_with_token", + "eval.tests.test_parser_validation.test_push_rejects_naked_name", + "eval.tests.test_parser_validation.test_push_rejects_two_versions", + "eval.tests.test_parser_validation.test_push_requires_dependency", + "eval.tests.test_parser_validation.test_typo_subcommand_rejected", + "eval.tests.test_parser_validation.test_uninstall_rejects_config_location_flag", + "eval.tests.test_parser_validation.test_uninstall_requires_dependency", + "eval.tests.test_parser_validation.test_unknown_flag_for_init_rejected", + "eval.tests.test_parser_validation.test_unknown_subcommand_rejected", + "eval.tests.test_parser_validation.test_update_accepts_config_location", + "eval.tests.test_parser_validation.test_update_g_and_d_flags_accepted", + "eval.tests.test_progress.test_install_missing_deps_uses_progress_and_updates_remappings[verbosity0]", + "eval.tests.test_progress.test_install_missing_deps_uses_progress_and_updates_remappings[verbosity1]", + "eval.tests.test_progress.test_install_resolves_bad_dependency_triggers_set_error[bogus~9.9.9]", + "eval.tests.test_progress.test_install_resolves_bad_dependency_triggers_set_error[definitely-not-a-valid-name~1.2.3]", + "eval.tests.test_progress.test_install_resolves_bad_dependency_triggers_set_error[no-such-package~0.0.1]", + "eval.tests.test_progress.test_tui_disabled_drain_init_creates_foundry_config", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity0-None]", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity1-None]", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity2-None]", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity3-error]", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity4-info]", + "eval.tests.test_progress.test_tui_disabled_install_drains_monitors[verbosity5-debug]", + "eval.tests.test_progress.test_tui_enabled_init_prints_intro_and_progress", + "eval.tests.test_version_banner.test_double_dash_version_prints_exact_line", + "eval.tests.test_version_banner.test_double_verbose_suppresses_banner", + "eval.tests.test_version_banner.test_normal_command_prints_exact_banner[clean]", + "eval.tests.test_version_banner.test_normal_command_prints_exact_banner[init]", + "eval.tests.test_version_banner.test_normal_command_prints_exact_banner[install]", + "eval.tests.test_version_banner.test_normal_command_prints_exact_banner[login]", + "eval.tests.test_version_banner.test_normal_command_prints_exact_banner[update]", + "eval.tests.test_version_banner.test_push_banner_exact", + "eval.tests.test_version_banner.test_quiet_flag_suppresses_banner", + "eval.tests.test_version_banner.test_uninstall_banner_exact", + "eval.tests.test_version_banner.test_verbose_flag_suppresses_banner", + "eval.tests.test_version_banner.test_verbose_version_subcommand_keeps_only_version", + "eval.tests.test_version_banner.test_version_flag_and_subcommand_agree[--version]", + "eval.tests.test_version_banner.test_version_flag_and_subcommand_agree[-V]", + "eval.tests.test_version_banner.test_version_flag_prints_exact_line", + "eval.tests.test_version_banner.test_version_subcommand_prints_banner_then_version" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_clean.test_clean_accepts_help_and_version_flags", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_clean.test_clean_default_output_mentions_done", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_clean.test_clean_flags_are_dash_prefixed_only", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_clean.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_clean.test_clean_rejects_unknown_option", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_clean.test_clean_requires_detected_config_prompt_path", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_clean.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_clean_rejects_config_location_flag", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_validation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_config_location_accepts_valid_values[foundry-foundry.toml]", + "reasons": [ + { + "detail": "assert False + where False = ('[dependencies]') + where = '[profile.default]\\ns", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[bare_tilde]", + "reasons": [ + { + "detail": "AssertionError: assert not True + where True = exists() + where exists = (PosixPath('/tmp/pytest-of-root/pytest-2/popen-gw8/test_install_single_tilde_acce0') / 'dependencies').exists", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[empty_name]", + "reasons": [ + { + "detail": "AssertionError: assert not True + where True = exists() + where exists = (PosixPath('/tmp/pytest-of-root/pytest-2/popen-gw9/test_install_single_tilde_acce0') / 'dependencies').exists", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[garbage_version]", + "reasons": [ + { + "detail": "AssertionError: assert not True + where True = exists() + where exists = (PosixPath('/tmp/pytest-of-root/pytest-2/popen-gw8/test_install_single_tilde_acce1') / 'dependencies').exists", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_uninstall_requires_positional", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_validation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_unknown_flag_rejected[clean]", + "reasons": [ + { + "detail": "assert \"tip: to pass '--bogus' as a value, use '-- --bogus'\" in \"error: unexpected argument '--bogus' found\\n\\nUsage: executable clean [OPTIONS]\\n\\nFor more information, try '--help'.\" + where \"error:", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_unknown_flag_rejected[init]", + "reasons": [ + { + "detail": "assert \"tip: to pass '--bogus' as a value, use '-- --bogus'\" in \"error: unexpected argument '--bogus' found\\n\\nUsage: executable init [OPTIONS]\\n\\nFor more information, try '--help'.\" + where \"error:", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli_validation.test_unknown_flag_rejected[update]", + "reasons": [ + { + "detail": "assert \"tip: to pass '--bogus' as a value, use '-- --bogus'\" in \"error: unexpected argument '--bogus' found\\n\\nUsage: executable update [OPTIONS]\\n\\nFor more information, try '--help'.\" + where \"error", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_command_error_paths.test_install_then_uninstall_removes_all_artifacts", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_command_error_paths.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_location.test_config_location_rejects_unused_value_for_clean", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_location.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_config_location.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_banner_streams_to_stdout_only", + "reasons": [ + { + "detail": "AssertionError: assert False + where False = ('Solidity Package Manager') + where = '\\n+-", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_foundry_location_creates_foundry_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_preserves_existing_config", + "reasons": [ + { + "detail": "assert 'keepme = { version = \"1.0.0\" }' in '[dependencies]\\nkeepme = { version = \\'1.0.0\\' }\\nforge-std = \"1.16.2\"\\n'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_additional.test_init_existing_foundry_libs_not_duplicated", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_additional.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_appends_soldeer_block_to_gitignore", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_banner_on_stdout_tui_on_stderr", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_clean_without_lib_dir_still_initializes", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_config_location_soldeer_writes_dependency_entry", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_existing_foundry_config_gets_libs_added", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_foundry_config_writes_template_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_lockfile_records_forge_std_table", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init_coverage.test_init_without_config_location_aborts_on_prompt", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init_coverage.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install.test_install_config_location_foundry_creates_foundry_toml", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_install.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install.test_install_preserves_existing_soldeer_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_install.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install.test_install_rejects_missing_config_via_prompt_failure", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_install.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install_addition.test_install_regenerate_remappings_from_existing_config", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_install_addition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install_addition.test_install_single_dependency_appends_lockfile", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_install_addition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install_addition.test_install_single_dependency_writes_config_entry", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_install_addition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_install_addition.test_install_single_dependency_writes_remapping", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_install_addition.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_uninstall.test_uninstall_missing_config_prompt_failure", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_uninstall.test_uninstall_removes_entry_from_config_then_downloads_fail", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_uninstall.test_uninstall_requires_dependency_argument", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_uninstall.test_uninstall_version_suffixed_name_does_not_match_config_key", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_uninstall.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update.test_update_config_location_foundry_creates_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update.test_update_missing_config_prompt_failure", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_clean.test_clean_accepts_help_and_version_flags", + "eval.tests.test_clean.test_clean_default_output_mentions_done", + "eval.tests.test_clean.test_clean_double_clean_is_idempotent", + "eval.tests.test_clean.test_clean_flags_are_dash_prefixed_only", + "eval.tests.test_clean.test_clean_noop_when_dependencies_absent", + "eval.tests.test_clean.test_clean_quiet_suppresses_banner", + "eval.tests.test_clean.test_clean_quiet_uses_soldeer_config_detection", + "eval.tests.test_clean.test_clean_rejects_unknown_config_location_option", + "eval.tests.test_clean.test_clean_rejects_unknown_option", + "eval.tests.test_clean.test_clean_removes_deps_but_keeps_config", + "eval.tests.test_clean.test_clean_removes_populated_dependencies_dir", + "eval.tests.test_clean.test_clean_requires_detected_config_prompt_path", + "eval.tests.test_cli_validation.test_clean_rejects_config_location_flag", + "eval.tests.test_cli_validation.test_config_location_accepts_valid_values[foundry-foundry.toml]", + "eval.tests.test_cli_validation.test_config_location_accepts_valid_values[soldeer-soldeer.toml]", + "eval.tests.test_cli_validation.test_config_location_invalid_value[init]", + "eval.tests.test_cli_validation.test_config_location_invalid_value[install]", + "eval.tests.test_cli_validation.test_config_location_invalid_value[update]", + "eval.tests.test_cli_validation.test_global_version_line", + "eval.tests.test_cli_validation.test_init_rejects_positional", + "eval.tests.test_cli_validation.test_install_accepts_identifier_with_git", + "eval.tests.test_cli_validation.test_install_identifier_requires_git[branch]", + "eval.tests.test_cli_validation.test_install_identifier_requires_git[rev]", + "eval.tests.test_cli_validation.test_install_identifier_requires_git[tag]", + "eval.tests.test_cli_validation.test_install_rejects_identifier_group_conflict[branch_tag]", + "eval.tests.test_cli_validation.test_install_rejects_identifier_group_conflict[rev_branch]", + "eval.tests.test_cli_validation.test_install_rejects_identifier_group_conflict[rev_tag]", + "eval.tests.test_cli_validation.test_install_rejects_malformed_dependency_format[four_parts]", + "eval.tests.test_cli_validation.test_install_rejects_malformed_dependency_format[no_tilde]", + "eval.tests.test_cli_validation.test_install_rejects_malformed_dependency_format[two_tildes]", + "eval.tests.test_cli_validation.test_install_rejects_malformed_dependency_format[whitespace]", + "eval.tests.test_cli_validation.test_install_requires_dependency_for_url_and_git[git_without_dep]", + "eval.tests.test_cli_validation.test_install_requires_dependency_for_url_and_git[url_without_dep]", + "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[bare_tilde]", + "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[empty_name]", + "eval.tests.test_cli_validation.test_install_single_tilde_accepted_then_download_reports_not_found[garbage_version]", + "eval.tests.test_cli_validation.test_install_url_and_git_conflict", + "eval.tests.test_cli_validation.test_install_url_with_rev_accepts_then_download_reports_error", + "eval.tests.test_cli_validation.test_uninstall_rejects_extra_positional", + "eval.tests.test_cli_validation.test_uninstall_requires_positional", + "eval.tests.test_cli_validation.test_unknown_flag_rejected[clean]", + "eval.tests.test_cli_validation.test_unknown_flag_rejected[init]", + "eval.tests.test_cli_validation.test_unknown_flag_rejected[install]", + "eval.tests.test_cli_validation.test_unknown_flag_rejected[uninstall]", + "eval.tests.test_cli_validation.test_unknown_flag_rejected[update]", + "eval.tests.test_cli_validation.test_unrecognized_subcommand", + "eval.tests.test_cli_validation.test_update_rejects_positional", + "eval.tests.test_command_error_paths.test_clean_tolerates_malformed_config", + "eval.tests.test_command_error_paths.test_install_after_uninstall_recovery", + "eval.tests.test_command_error_paths.test_install_then_uninstall_removes_all_artifacts", + "eval.tests.test_command_error_paths.test_malformed_config_errors_gracefully[init]", + "eval.tests.test_command_error_paths.test_malformed_config_errors_gracefully[install]", + "eval.tests.test_command_error_paths.test_malformed_config_errors_gracefully[update]", + "eval.tests.test_command_error_paths.test_uninstall_second_time_reports_not_found", + "eval.tests.test_config_location.test_config_location_flag_avoids_prompt_on_empty_root", + "eval.tests.test_config_location.test_config_location_flag_overrides_foundry", + "eval.tests.test_config_location.test_config_location_flag_overrides_soldeer", + "eval.tests.test_config_location.test_config_location_rejects_unused_value_for_clean", + "eval.tests.test_config_location.test_foundry_toml_with_dependencies_detects_foundry", + "eval.tests.test_config_location.test_foundry_toml_without_deps_fails_detection", + "eval.tests.test_config_location.test_foundry_toml_without_deps_ignores_present_soldeer", + "eval.tests.test_config_location.test_no_config_triggers_prompt_failure", + "eval.tests.test_config_location.test_soldeer_toml_only_detects_soldeer", + "eval.tests.test_init.test_init_banner_streams_to_stdout_only", + "eval.tests.test_init.test_init_clean_flag_without_lib_initializes", + "eval.tests.test_init.test_init_foundry_location_creates_foundry_config", + "eval.tests.test_init.test_init_preserves_existing_config", + "eval.tests.test_init.test_init_quiet_suppresses_all_output", + "eval.tests.test_init.test_init_repeated_runs_are_stable", + "eval.tests.test_init.test_init_soldeer_location_creates_deps_dir_and_config", + "eval.tests.test_init.test_init_soldeer_location_prefers_soldeer_config", + "eval.tests.test_init.test_init_without_config_location_fails_in_nontty", + "eval.tests.test_init_additional.test_init_existing_foundry_libs_not_duplicated", + "eval.tests.test_init_additional.test_init_gitignore_dependencies_substring_suppresses_append", + "eval.tests.test_init_additional.test_init_gitignore_existing_soldeer_block_unchanged", + "eval.tests.test_init_additional.test_init_is_idempotent_across_repeated_runs", + "eval.tests.test_init_additional.test_init_pre_seeded_config_stays_single_entry", + "eval.tests.test_init_additional.test_init_preserves_unrelated_dependencies_content", + "eval.tests.test_init_coverage.test_init_appends_soldeer_block_to_gitignore", + "eval.tests.test_init_coverage.test_init_banner_on_stdout_tui_on_stderr", + "eval.tests.test_init_coverage.test_init_clean_removes_gitmodules_file", + "eval.tests.test_init_coverage.test_init_clean_removes_lib_directory", + "eval.tests.test_init_coverage.test_init_clean_without_lib_dir_still_initializes", + "eval.tests.test_init_coverage.test_init_config_location_soldeer_writes_dependency_entry", + "eval.tests.test_init_coverage.test_init_existing_foundry_config_gets_libs_added", + "eval.tests.test_init_coverage.test_init_foundry_config_writes_template_golden", + "eval.tests.test_init_coverage.test_init_gitignore_not_duplicated_when_already_present", + "eval.tests.test_init_coverage.test_init_installs_forge_std_into_dependencies_dir", + "eval.tests.test_init_coverage.test_init_lockfile_records_forge_std_table", + "eval.tests.test_init_coverage.test_init_no_gitignore_means_none_created", + "eval.tests.test_init_coverage.test_init_quiet_no_output_at_all", + "eval.tests.test_init_coverage.test_init_remappings_contains_forge_std", + "eval.tests.test_init_coverage.test_init_soldeer_location_does_not_create_foundry_toml", + "eval.tests.test_init_coverage.test_init_without_config_location_aborts_on_prompt", + "eval.tests.test_install.test_install_clean_flag_on_empty_set_is_noop", + "eval.tests.test_install.test_install_config_location_foundry_creates_foundry_toml", + "eval.tests.test_install.test_install_config_location_soldeer_creates_soldeer_toml", + "eval.tests.test_install.test_install_does_not_remove_existing_remappings_content", + "eval.tests.test_install.test_install_empty_config_creates_artifacts", + "eval.tests.test_install.test_install_empty_config_lock_content", + "eval.tests.test_install.test_install_empty_config_report_success", + "eval.tests.test_install.test_install_lockfile_empty_when_no_deps", + "eval.tests.test_install.test_install_preserves_existing_soldeer_config", + "eval.tests.test_install.test_install_quiet_suppresses_output", + "eval.tests.test_install.test_install_recursive_deps_flag_accepted", + "eval.tests.test_install.test_install_regenerate_remappings_flag_accepted", + "eval.tests.test_install.test_install_rejects_missing_config_via_prompt_failure", + "eval.tests.test_install.test_install_uses_root_env_override", + "eval.tests.test_install_addition.test_install_clean_removes_prior_dependency_tree", + "eval.tests.test_install_addition.test_install_regenerate_remappings_from_existing_config", + "eval.tests.test_install_addition.test_install_single_dependency_appends_lockfile", + "eval.tests.test_install_addition.test_install_single_dependency_idempotent_config", + "eval.tests.test_install_addition.test_install_single_dependency_materializes_dir", + "eval.tests.test_install_addition.test_install_single_dependency_writes_config_entry", + "eval.tests.test_install_addition.test_install_single_dependency_writes_remapping", + "eval.tests.test_uninstall.test_uninstall_default_output_reports_config_removal", + "eval.tests.test_uninstall.test_uninstall_did_not_create_workspace", + "eval.tests.test_uninstall.test_uninstall_missing_config_prompt_failure", + "eval.tests.test_uninstall.test_uninstall_quiet_suppresses_output", + "eval.tests.test_uninstall.test_uninstall_removes_entry_from_config_then_downloads_fail", + "eval.tests.test_uninstall.test_uninstall_requires_dependency_argument", + "eval.tests.test_uninstall.test_uninstall_unknown_dependency_errors", + "eval.tests.test_uninstall.test_uninstall_version_suffixed_name_does_not_match_config_key", + "eval.tests.test_update.test_update_config_location_foundry_creates_config", + "eval.tests.test_update.test_update_config_location_soldeer_creates_config", + "eval.tests.test_update.test_update_empty_config_creates_artifacts", + "eval.tests.test_update.test_update_empty_config_reports_success", + "eval.tests.test_update.test_update_idempotent", + "eval.tests.test_update.test_update_missing_config_prompt_failure", + "eval.tests.test_update.test_update_quiet_suppresses_output", + "eval.tests.test_update.test_update_recursive_deps_flag", + "eval.tests.test_update.test_update_regenerate_remappings_flag" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_login_cli.test_login_help_lists_token_option", + "reasons": [ + { + "detail": "AssertionError: assert 'Log into the central repository to push packages' in ''", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_cli.test_login_short_help_succeeds", + "reasons": [ + { + "detail": "AssertionError: assert '--token ' in '' + where '' = .err", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_credentials", + "reasons": [ + { + "detail": "collection failure", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_persisted_token_satisfies_push_read", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw2/test_persisted_token_satisfies0/lf'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_401_reports_invalid_token", + "reasons": [ + { + "detail": "AssertionError: assert 'error during login: login error: invalid token' in 'T \ud83e\udd8c Soldeer Login \ud83e\udd8c\\n|\\n+ If you do not have an account, please visit soldeer.xyz to create one.\\n| \\n\u2014 An error ...ring log", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_500_reports_http_error", + "reasons": [ + { + "detail": "AssertionError: assert '500' in 'T \ud83e\udd8c Soldeer Login \ud83e\udd8c\\n|\\n+ If you do not have an account, please visit soldeer.xyz to create one.\\n| \\n\u2014 An error ...ring login: HTTP status client error (404 Not Found", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_connection_refused_reports_http_error", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_overwrites_existing_login_file", + "reasons": [ + { + "detail": "AssertionError: assert 'old-stale-token' == 'fresh-token' - fresh-token + old-stale-token", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_success_non_tui_writes_token", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw1/test_token_success_non_tui_wri0/lf'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_success_saves_token_to_login_file", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw9/test_token_success_saves_token0/lf'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_success_tui_message_prints_username_and_path", + "reasons": [ + { + "detail": "AssertionError: assert 'Token is valid for user alice' in 'T \ud83e\udd8c Soldeer Login \ud83e\udd8c\\n|\\n+ If you do not have an account, please visit soldeer.xyz to create one.\\n| \\n\u2014 An error ...ring login: HTTP status c", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_login_token.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_login_token.test_token_trims_leading_and_trailing_whitespace", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw11/test_token_trims_leading_and_t0/lf'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_login_cli.test_login_default_requires_arg_or_tui", + "eval.tests.test_login_cli.test_login_email_without_password_tui_disabled", + "eval.tests.test_login_cli.test_login_help_lists_token_option", + "eval.tests.test_login_cli.test_login_password_without_email_tui_disabled", + "eval.tests.test_login_cli.test_login_short_help_succeeds", + "eval.tests.test_login_cli.test_login_token_email_conflict_is_clap_error", + "eval.tests.test_login_cli.test_login_token_password_conflict_is_clap_error", + "eval.tests.test_login_cli.test_login_unknown_flag_rejected", + "eval.tests.test_login_credentials", + "eval.tests.test_login_token.test_persisted_token_satisfies_push_read", + "eval.tests.test_login_token.test_token_401_does_not_write_token_file", + "eval.tests.test_login_token.test_token_401_reports_invalid_token", + "eval.tests.test_login_token.test_token_500_reports_http_error", + "eval.tests.test_login_token.test_token_connection_refused_reports_http_error", + "eval.tests.test_login_token.test_token_overwrites_existing_login_file", + "eval.tests.test_login_token.test_token_success_calls_validate_endpoint", + "eval.tests.test_login_token.test_token_success_non_tui_writes_token", + "eval.tests.test_login_token.test_token_success_saves_token_to_login_file", + "eval.tests.test_login_token.test_token_success_tui_message_prints_username_and_path", + "eval.tests.test_login_token.test_token_trims_leading_and_trailing_whitespace" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_auth_token_sources.test_install_registry_dep_sends_bearer_header", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_auth_token_sources.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_foundry_config_keeps_comment_default", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_install_existing_soldeer_toml_not_overwritten", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_install_foundry_creates_template_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_install_local_zip_adds_to_foundry_config", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_install_local_zip_adds_to_soldeer_config", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_uninstall_preserves_other_deps", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_update_config_libs_keeps_existing_libs", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_creation.test_update_config_libs_reusing_empty_foundry", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_creation.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[]", + "reasons": [ + { + "detail": "assert 'invalid value' in \"error: a value is required for '--config-location ' but none was supplied\\n [possible values: foundry, soldeer]\\n\\nfor more information, try '--help'.\\n\" +", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_config_detection.test_no_config_no_flag_prompts_and_fails", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_config_detection.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_detection.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_parse_deps.test_equals_version_rejected_with_custom_url[\"h\" = { version = \"^1.0.0\", url = \"https://u\" }-the version requirement string for h cannot contain the equal symbol]", + "reasons": [ + { + "detail": "AssertionError: assert False + where False = has_stderr('the version requirement string for h cannot contain the equal symbol') + where has_stderr = .has_s", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_clean_non_git_lib_errors_with_git_message", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_init.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_config_location_foundry_creates_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_config_location_soldeer_creates_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_init.test_init_reuses_existing_foundry_config", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_init.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_lockfile.test_install_second_dep_merges_into_lock", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw6/test_install_second_dep_merges0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_lockfile.test_install_upgrades_existing_lock_entry", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw12/test_install_upgrades_existing0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_lockfile.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_lockfile.test_install_writes_lock_for_local_zip_dep", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw11/test_install_writes_lock_for_l0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_lockfile.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_lockfile.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_lockfile.test_lock_checksum_is_archive_sha256", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw5/test_lock_checksum_is_archive_0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_lockfile.test_lock_entries_sorted_by_name", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw10/test_lock_entries_sorted_by_na0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_branch_advances_commit", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw7/test_update_branch_advances_co0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_branch_no_new_commit_keeps_rev", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw0/test_update_branch_no_new_comm0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_default_branch_dep_follows_head", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw4/test_update_default_branch_dep0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_explicit_nondefault_branch", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw1/test_update_explicit_nondefaul0/soldeer.lock'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_git_branch_after_manual_change_resets_hard", + "reasons": [ + { + "detail": "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-2/popen-gw5/test_update_git_branch_after_m0/dependencies/rst-1.0.0/lib.sol'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_git_dep_install_folder_exists_after", + "reasons": [ + { + "detail": "AssertionError: assert False + where False = is_dir() + where is_dir = PosixPath('/tmp/pytest-of-root/pytest-2/popen-gw13/test_update_git_dep_install_fo0/dependencies/onex-1.0.0').is_dir", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_update_git.test_update_mixed_git_and_http_deps", + "reasons": [ + { + "detail": "AssertionError: assert False + where False = has_stderr('Done updating!') + where has_stderr = .has_stderr", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_git.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_bumps_http_version_when_new_available", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_caret_range_picks_highest_matching", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_custom_url_dep_uses_explicit_url", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_custom_url_with_new_commit_preserves_url_in_lock", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_exact_range_requires_matching", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_freshly_installs_http_dep_at_latest", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_non_semver_exact_match", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_pinned_exact_version_keeps_version", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_preserves_unrelated_lock_entries", + "reasons": [ + { + "detail": "assert 'name = \"zzkeep\"' in '[[dependencies]]\\nname = \"ccore\"\\nversion = \"1.0.0\"\\nurl = \"http://127.0.0.1:34907/ccore-1.0.0.zip\"\\nchecksum = \"6325...2f8b2e04a50f73c351da0c1f02f3a622301\"\\nintegrity = \"", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_stays_at_latest_when_lock_matches", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_tilde_range_picks_highest_within_patch", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_update_http.test_update_wildcard_requirement_selects_newest", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_update_http.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_auth_token_sources.test_install_registry_dep_sends_bearer_header", + "eval.tests.test_auth_token_sources.test_update_empty_login_file_sends_no_auth_header", + "eval.tests.test_auth_token_sources.test_update_env_token_precedence_over_file", + "eval.tests.test_auth_token_sources.test_update_env_token_sends_bearer_header", + "eval.tests.test_auth_token_sources.test_update_login_file_token_sends_bearer", + "eval.tests.test_auth_token_sources.test_update_no_token_sends_no_auth_header", + "eval.tests.test_clean.test_clean_after_install_clears_extracted_deps", + "eval.tests.test_clean.test_clean_nested_deps_fully_removed", + "eval.tests.test_clean.test_clean_no_config_fails_with_prompt_error", + "eval.tests.test_clean.test_clean_preserves_config_files", + "eval.tests.test_clean.test_clean_removes_dependencies_folder", + "eval.tests.test_clean.test_clean_uses_soldeer_toml_when_resolved", + "eval.tests.test_clean.test_clean_when_no_dependencies_folder_is_noop", + "eval.tests.test_config_creation.test_foundry_config_keeps_comment_default", + "eval.tests.test_config_creation.test_install_existing_soldeer_toml_not_overwritten", + "eval.tests.test_config_creation.test_install_foundry_creates_template_config", + "eval.tests.test_config_creation.test_install_local_zip_adds_to_foundry_config", + "eval.tests.test_config_creation.test_install_local_zip_adds_to_soldeer_config", + "eval.tests.test_config_creation.test_install_local_zip_then_uninstall_removes_from_config", + "eval.tests.test_config_creation.test_install_soldeer_creates_toml", + "eval.tests.test_config_creation.test_uninstall_adds_and_removes_foundry_dep", + "eval.tests.test_config_creation.test_uninstall_missing_dep_error", + "eval.tests.test_config_creation.test_uninstall_preserves_other_deps", + "eval.tests.test_config_creation.test_uninstall_removes_soldeer_toml_dep", + "eval.tests.test_config_creation.test_update_config_libs_keeps_existing_libs", + "eval.tests.test_config_creation.test_update_config_libs_reusing_empty_foundry", + "eval.tests.test_config_detection.test_detect_prefers_foundry_when_both_but_foundry_has_deps", + "eval.tests.test_config_detection.test_explicit_config_location_foundry_bypasses_detection", + "eval.tests.test_config_detection.test_explicit_config_location_soldeer_creates_soldeer_toml", + "eval.tests.test_config_detection.test_foundry_dependencies_takes_precedence_over_soldeer", + "eval.tests.test_config_detection.test_foundry_with_dependencies_table_is_detected", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[FOUNDRY CONFIG]", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[FOUNDRY]", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[]", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[foundary]", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[soldeerx]", + "eval.tests.test_config_detection.test_invalid_config_location_value_rejected[toml]", + "eval.tests.test_config_detection.test_no_config_no_flag_prompts_and_fails", + "eval.tests.test_config_detection.test_soldeer_toml_detected_when_no_foundry_at_all", + "eval.tests.test_config_detection.test_soldeer_toml_detected_when_no_foundry_dependencies", + "eval.tests.test_config_parse_deps.test_equals_version_allowed_without_custom_url", + "eval.tests.test_config_parse_deps.test_equals_version_rejected_with_custom_url[\"g\" = { version = \"=1.0.0\", git = \"https://h.git\" }-the version requirement string for g cannot contain the equal symbol]", + "eval.tests.test_config_parse_deps.test_equals_version_rejected_with_custom_url[\"h\" = { version = \"^1.0.0\", url = \"https://u\" }-the version requirement string for h cannot contain the equal symbol]", + "eval.tests.test_config_parse_deps.test_git_dep_rev_only_is_valid", + "eval.tests.test_config_parse_deps.test_git_dep_tag_only_is_valid", + "eval.tests.test_config_parse_deps.test_http_dep_with_invalid_project_root_rejected", + "eval.tests.test_config_parse_deps.test_http_dep_with_project_root_is_valid", + "eval.tests.test_config_parse_deps.test_ignored_git_fields_on_http_produce_warning", + "eval.tests.test_config_parse_deps.test_invalid_version_field_rejected[\"n\" = { version = 123 }-error during config operation: invalid `version` field in n]", + "eval.tests.test_config_parse_deps.test_invalid_version_field_rejected[\"p\" = { version = 1.2 }-error during config operation: invalid `version` field in p]", + "eval.tests.test_config_parse_deps.test_invalid_version_field_rejected[\"x\" = \"\"-error during config operation: empty `version` field in x]", + "eval.tests.test_config_parse_deps.test_invalid_version_field_rejected[\"y\" = { url = \"https://u\" }-error during config operation: missing `version` field in y]", + "eval.tests.test_config_parse_deps.test_mixed_valid_and_invalid_reports_only_invalid", + "eval.tests.test_config_parse_deps.test_multiple_git_identifiers_rejected[\"r\" = { version = \"1.0.0\", git = \"https://g\", rev = \"a\", branch = \"b\" }-only one of `rev`, `branch` or `tag` can be specified for git dependency r]", + "eval.tests.test_config_parse_deps.test_multiple_git_identifiers_rejected[\"s\" = { version = \"1.0.0\", git = \"https://g\", rev = \"a\", tag = \"t\" }-only one of `rev`, `branch` or `tag` can be specified for git dependency s]", + "eval.tests.test_config_parse_deps.test_multiple_git_identifiers_rejected[\"t\" = { version = \"1.0.0\", git = \"https://g\", branch = \"b\", tag = \"t\" }-only one of `rev`, `branch` or `tag` can be specified for git dependency t]", + "eval.tests.test_config_parse_deps.test_non_string_dependency_field_rejected[\"boom\" = { version = \"1.0.0\", git = \"https://g\", tag = 42 }-error during config operation: invalid `tag` field in boom]", + "eval.tests.test_config_parse_deps.test_non_string_dependency_field_rejected[\"u\" = { version = \"1.0.0\", url = 42 }-error during config operation: invalid `url` field in u]", + "eval.tests.test_config_parse_deps.test_non_string_dependency_field_rejected[\"v\" = { version = \"1.0.0\", git = 42 }-error during config operation: invalid `git` field in v]", + "eval.tests.test_config_parse_deps.test_non_string_dependency_field_rejected[\"w\" = { version = \"1.0.0\", git = \"https://g\", rev = 42 }-error during config operation: invalid `rev` field in w]", + "eval.tests.test_config_parse_deps.test_non_string_dependency_field_rejected[\"x\" = { version = \"1.0.0\", git = \"https://g\", branch = 42 }-error during config operation: invalid `branch` field in x]", + "eval.tests.test_config_parse_deps.test_unknown_dependency_key_produces_warning", + "eval.tests.test_config_parse_deps.test_url_and_git_conflict_rejected[\"c\" = { version = \"1.0.0\", url = \"https://u\", git = \"https://g\" }-error during config operation: field `url` conflicts with `git` in c]", + "eval.tests.test_config_parse_deps.test_valid_dependency_parses_past_validation", + "eval.tests.test_init.test_init_clean_non_git_lib_errors_with_git_message", + "eval.tests.test_init.test_init_config_location_foundry_creates_config", + "eval.tests.test_init.test_init_config_location_soldeer_creates_config", + "eval.tests.test_init.test_init_reuses_existing_foundry_config", + "eval.tests.test_lockfile.test_install_empty_deps_writes_empty_lock", + "eval.tests.test_lockfile.test_install_second_dep_merges_into_lock", + "eval.tests.test_lockfile.test_install_upgrades_existing_lock_entry", + "eval.tests.test_lockfile.test_install_with_clean_flag_rewrites_lock", + "eval.tests.test_lockfile.test_install_with_prepopulated_lock_preserves_other_entries", + "eval.tests.test_lockfile.test_install_writes_lock_for_local_zip_dep", + "eval.tests.test_lockfile.test_lock_checksum_is_archive_sha256", + "eval.tests.test_lockfile.test_lock_entries_sorted_by_name", + "eval.tests.test_lockfile.test_lock_parsing_tolerates_invalid_entry", + "eval.tests.test_lockfile.test_lock_parsing_tolerates_missing_lock_file", + "eval.tests.test_lockfile.test_update_empty_deps_writes_empty_lock", + "eval.tests.test_uninstall_engine.test_uninstall_end_to_end_removes_all", + "eval.tests.test_uninstall_engine.test_uninstall_keeps_other_lock_entries", + "eval.tests.test_uninstall_engine.test_uninstall_missing_dependency_error", + "eval.tests.test_uninstall_engine.test_uninstall_no_config_prompt_error", + "eval.tests.test_uninstall_engine.test_uninstall_non_present_name_errors[UPPER]", + "eval.tests.test_uninstall_engine.test_uninstall_non_present_name_errors[with-dash]", + "eval.tests.test_uninstall_engine.test_uninstall_non_present_name_errors[with@at]", + "eval.tests.test_uninstall_engine.test_uninstall_non_present_name_errors[with_underscore]", + "eval.tests.test_uninstall_engine.test_uninstall_preserves_unrelated_dep_remap", + "eval.tests.test_uninstall_engine.test_uninstall_removes_from_soldeer_config_end_to_end", + "eval.tests.test_uninstall_engine.test_uninstall_removes_last_lock_entry_and_deletes_lock", + "eval.tests.test_uninstall_engine.test_uninstall_without_installed_dir_still_removes_config", + "eval.tests.test_update_git.test_update_branch_advances_commit", + "eval.tests.test_update_git.test_update_branch_no_new_commit_keeps_rev", + "eval.tests.test_update_git.test_update_default_branch_dep_follows_head", + "eval.tests.test_update_git.test_update_explicit_nondefault_branch", + "eval.tests.test_update_git.test_update_git_branch_after_manual_change_resets_hard", + "eval.tests.test_update_git.test_update_git_dep_install_folder_exists_after", + "eval.tests.test_update_git.test_update_mixed_git_and_http_deps", + "eval.tests.test_update_git.test_update_rev_pinned_dep_keeps_rev", + "eval.tests.test_update_git.test_update_tag_pinned_dep_keeps_rev", + "eval.tests.test_update_http.test_update_bumps_http_version_when_new_available", + "eval.tests.test_update_http.test_update_caret_range_picks_highest_matching", + "eval.tests.test_update_http.test_update_custom_url_dep_uses_explicit_url", + "eval.tests.test_update_http.test_update_custom_url_with_new_commit_preserves_url_in_lock", + "eval.tests.test_update_http.test_update_download_404_error_custom_url", + "eval.tests.test_update_http.test_update_exact_range_requires_matching", + "eval.tests.test_update_http.test_update_freshly_installs_http_dep_at_latest", + "eval.tests.test_update_http.test_update_http_dep_creates_extracted_folder_with_content", + "eval.tests.test_update_http.test_update_lock_checksum_is_archive_sha256", + "eval.tests.test_update_http.test_update_merges_multiple_http_deps_sorted", + "eval.tests.test_update_http.test_update_no_matching_version_error", + "eval.tests.test_update_http.test_update_non_semver_exact_match", + "eval.tests.test_update_http.test_update_pinned_exact_version_keeps_version", + "eval.tests.test_update_http.test_update_preserves_unrelated_lock_entries", + "eval.tests.test_update_http.test_update_stays_at_latest_when_lock_matches", + "eval.tests.test_update_http.test_update_tilde_range_picks_highest_within_patch", + "eval.tests.test_update_http.test_update_unknown_package_error", + "eval.tests.test_update_http.test_update_wildcard_requirement_selects_newest" + ] + } + }, + "commit": "e4aac28659531229105c756d8f76c2afad16d924", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.943593432768369, + "eval_clean_hashes": [ + "e3ae1a13faf26035e82419cda069ef257be2170460e055760f33e13837f50310" + ], + "input_record": { + "codeql_db_mb": 85.54, + "codeql_status": true, + "codeql_time": 42.0653803772293, + "commit": "e4aac28659531229105c756d8f76c2afad16d924", + "commits": 256, + "contributors": 13, + "difficulty": "easy", + "difficulty_code_lines": 8782, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 8782, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.943593432768369, + "difficulty_test_code_lines": 2215, + "full_name": "mario-eth/soldeer", + "github_stars": 389, + "input_codeql_db": "rust_codeql/mario-eth__soldeer", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "Stranger6667/jsonschema", + "rank": 710, + "similarity": 0.3757220506668091 + }, + { + "pb_fullname": "BLAKE3-team/BLAKE3", + "rank": 353, + "similarity": 0.4291951060295105 + }, + { + "pb_fullname": "rust-ethereum/ethabi", + "rank": 75, + "similarity": 0.5763686299324036 + }, + { + "pb_fullname": "oppiliappan/statix", + "rank": 652, + "similarity": 0.4530043601989746 + }, + { + "pb_fullname": "paradigmxyz/solar", + "rank": 10, + "similarity": 0.6658868193626404 + }, + { + "pb_fullname": "rust-embedded/svd2rust", + "rank": 293, + "similarity": 0.5310729742050171 + }, + { + "pb_fullname": "axodotdev/oranda", + "rank": 516, + "similarity": 0.49900662899017334 + }, + { + "pb_fullname": "cordx56/rustowl", + "rank": 759, + "similarity": 0.5833888053894043 + }, + { + "pb_fullname": "sitkevij/hex", + "rank": 967, + "similarity": 0.44991636276245117 + }, + { + "pb_fullname": "astro/deadnix", + "rank": 807, + "similarity": 0.46930330991744995 + }, + { + "pb_fullname": "sigoden/argc", + "rank": 793, + "similarity": 0.44952619075775146 + }, + { + "pb_fullname": "ast-grep/ast-grep", + "rank": 710, + "similarity": 0.5107067227363586 + }, + { + "pb_fullname": "ecumene/rust-sloth", + "rank": 346, + "similarity": 0.4890502691268921 + }, + { + "pb_fullname": "YS-L/flamelens", + "rank": 824, + "similarity": 0.47590017318725586 + } + ], + "repo_age": 3.01, + "repo_path": "rust/mario-eth__soldeer", + "rust_channel": "stable", + "rust_edition": "2024", + "rust_release_date": "2025-06-26", + "rust_version": "1.88.0", + "rust_version_source": "rust-version", + "source": "commit:e4aac28659531229105c756d8f76c2afad16d924", + "status": "done", + "url": "https://github.com/mario-eth/soldeer" + }, + "instance_id": "mario-eth__soldeer.e4aac28", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "mario-eth/soldeer" +} diff --git a/mario-eth--soldeer.e4aac28/tests/test.sh b/mario-eth--soldeer.e4aac28/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mario-eth--soldeer.e4aac28/tests/workspace.tar.gz b/mario-eth--soldeer.e4aac28/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..930dbd54914e8d4bae3dba64c51a11a7d28a481f --- /dev/null +++ b/mario-eth--soldeer.e4aac28/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6ed6328ce7edaa45857a9b4c73892ae75db643469ec5927eb354ff90853736a +size 48495 diff --git a/markbates--grift.416fdcd/environment/Dockerfile b/markbates--grift.416fdcd/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5cf965202bf3f2bdbe7faab773b15c8629800597 --- /dev/null +++ b/markbates--grift.416fdcd/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/markbates--grift.416fdcd/environment/download.sh b/markbates--grift.416fdcd/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4aad12a4f7246ec0e17496aab1b3c192f17a324 --- /dev/null +++ b/markbates--grift.416fdcd/environment/download.sh @@ -0,0 +1,174 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/markbates/grift + +go 1.13 + +require ( + github.com/gobuffalo/here v0.4.0 + github.com/stretchr/testify v1.4.0 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gobuffalo/here v0.4.0 h1:TD+FD+jQkp5iNPYEAxT6E+4O8u/pOQJyDjmZNC0+/80= +github.com/gobuffalo/here v0.4.0/go.mod h1:bTNk/uKZgycuB358iR0D32dI9kHBClBGpXjW2HVHkNo= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/markbates--grift.416fdcd/environment/executable b/markbates--grift.416fdcd/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..3640bfb147531480cd9f9ff71084847ecaca0737 --- /dev/null +++ b/markbates--grift.416fdcd/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7dd7a1e917c2f31ab929f54b5d28e3cbb5697dbdd1b4ec9030aeb01f1ce895ed +size 5737116 diff --git a/markbates--grift.416fdcd/environment/harbor_prepare_download_env.sh b/markbates--grift.416fdcd/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/markbates--grift.416fdcd/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/markbates--grift.416fdcd/environment/programgym-go.tar.gz b/markbates--grift.416fdcd/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/markbates--grift.416fdcd/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/markbates--grift.416fdcd/environment/workspace.tar.gz b/markbates--grift.416fdcd/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bf4c6a20501699c788eb473e190211722e76046f --- /dev/null +++ b/markbates--grift.416fdcd/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b351273e3cb916692ce246e45ad1e3653fa4f063a88baa87b06ca7b00f10c2b +size 1404 diff --git a/markbates--grift.416fdcd/instruction.md b/markbates--grift.416fdcd/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/markbates--grift.416fdcd/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/markbates--grift.416fdcd/solution/solve.sh b/markbates--grift.416fdcd/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/markbates--grift.416fdcd/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/markbates--grift.416fdcd/task.toml b/markbates--grift.416fdcd/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cdf7d8fbeb03debeee17ee1321168f66c257c243 --- /dev/null +++ b/markbates--grift.416fdcd/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/markbates--grift.416fdcd" +description = "Synthetic ProgramGym cleanroom reconstruction task for markbates/grift" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "markbates__grift.416fdcd" +repository = "markbates/grift" +commit = "416fdcd6c9961fcede9f39103647224e0d2d937a" +language = "go" +difficulty = "easy" +difficulty_score = 1.3121773564397787 +test_branches = 4 +test_count = 148 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/markbates--grift.416fdcd/tests/Dockerfile b/markbates--grift.416fdcd/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18982f72e90272de65d43f035f12bce826cee126 --- /dev/null +++ b/markbates--grift.416fdcd/tests/Dockerfile @@ -0,0 +1,73 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/markbates--grift.416fdcd/tests/blobs/tests/generated_module_01.tar.gz b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b5ee868e8ec6347ac564f5e0a901eb56bb4cd2d5 --- /dev/null +++ b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80c247390fea101a4ca0a05a3a48840bad9d61dc0a4df279010217d00626a164 +size 7146 diff --git a/markbates--grift.416fdcd/tests/blobs/tests/generated_module_02.tar.gz b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6761e8fc4946e9fab5c85e4c2709ffcfc57aebbe --- /dev/null +++ b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15619d81d3f2ec77616bfabd1d95ef96d8cd3ca655fcc60b894431d2471e51b1 +size 4442 diff --git a/markbates--grift.416fdcd/tests/blobs/tests/generated_module_03.tar.gz b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f756a212068dfcaec69bef0ab6ce8143b5493538 --- /dev/null +++ b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a33a62ef13ca92781ef4a2608e1e7217d285096531cfe93448173fc231f263ad +size 170441 diff --git a/markbates--grift.416fdcd/tests/blobs/tests/generated_module_04.tar.gz b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3306f0b28fd119e156650d35c8a81d9bb62949d6 --- /dev/null +++ b/markbates--grift.416fdcd/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a404ff1bc051e57685682e6381db776c925554c4de8b2b618284e943206ec65 +size 8796 diff --git a/markbates--grift.416fdcd/tests/download.sh b/markbates--grift.416fdcd/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4aad12a4f7246ec0e17496aab1b3c192f17a324 --- /dev/null +++ b/markbates--grift.416fdcd/tests/download.sh @@ -0,0 +1,174 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/markbates/grift + +go 1.13 + +require ( + github.com/gobuffalo/here v0.4.0 + github.com/stretchr/testify v1.4.0 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gobuffalo/here v0.4.0 h1:TD+FD+jQkp5iNPYEAxT6E+4O8u/pOQJyDjmZNC0+/80= +github.com/gobuffalo/here v0.4.0/go.mod h1:bTNk/uKZgycuB358iR0D32dI9kHBClBGpXjW2HVHkNo= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/markbates--grift.416fdcd/tests/executable b/markbates--grift.416fdcd/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..3640bfb147531480cd9f9ff71084847ecaca0737 --- /dev/null +++ b/markbates--grift.416fdcd/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7dd7a1e917c2f31ab929f54b5d28e3cbb5697dbdd1b4ec9030aeb01f1ce895ed +size 5737116 diff --git a/markbates--grift.416fdcd/tests/harbor_prepare_download_env.sh b/markbates--grift.416fdcd/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/markbates--grift.416fdcd/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/markbates--grift.416fdcd/tests/programgym-go.tar.gz b/markbates--grift.416fdcd/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/markbates--grift.416fdcd/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/markbates--grift.416fdcd/tests/programgym_evaluator.py b/markbates--grift.416fdcd/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/markbates--grift.416fdcd/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/markbates--grift.416fdcd/tests/programgym_task.json b/markbates--grift.416fdcd/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..fe6077c86b2bee37646618f56213c7978b23bd37 --- /dev/null +++ b/markbates--grift.416fdcd/tests/programgym_task.json @@ -0,0 +1,254 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_grift_cli.test_double_dash_help_exits_nonzero", + "eval.tests.test_grift_cli.test_help_flag_beats_positional", + "eval.tests.test_grift_cli.test_init_creates_grifts_package", + "eval.tests.test_grift_cli.test_init_is_idempotent", + "eval.tests.test_grift_cli.test_init_marks_grifts_directory", + "eval.tests.test_grift_cli.test_init_preserves_existing_grifts_files", + "eval.tests.test_grift_cli.test_jim_output_matches_golden", + "eval.tests.test_grift_cli.test_jim_with_extra_args_matches_golden", + "eval.tests.test_grift_cli.test_list_dispatch_does_not_pretend_success", + "eval.tests.test_grift_cli.test_long_version_flag_rejected", + "eval.tests.test_grift_cli.test_no_arguments_shows_help", + "eval.tests.test_grift_cli.test_short_help_flag", + "eval.tests.test_grift_cli.test_short_version_flag", + "eval.tests.test_grift_cli.test_single_dash_help_equals_double", + "eval.tests.test_grift_cli.test_task_with_arguments_dispatches_fails", + "eval.tests.test_grift_cli.test_unknown_long_flag_rejected", + "eval.tests.test_grift_cli.test_unknown_short_flag_rejected", + "eval.tests.test_grift_cli.test_unknown_task_dispatch_fails", + "eval.tests.test_grift_cli.test_version_flag_with_positional_task" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_main.test_bool_flag_false_with_no_positional_panics_evenly[help_flag_false_no_positional]", + "eval.tests.test_cli_main.test_bool_flag_false_with_no_positional_panics_evenly[version_flag_false_no_positional]", + "eval.tests.test_cli_main.test_bool_flag_with_invalid_value_reports_error[v_bool_non_numeric]", + "eval.tests.test_cli_main.test_bool_flag_with_invalid_value_reports_error[v_bool_non_numeric_alpha]", + "eval.tests.test_cli_main.test_help_flag_returns_help_requested_error[double_dash_help]", + "eval.tests.test_cli_main.test_help_flag_returns_help_requested_error[single_dash_help]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[double_dash_h]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[h_then_v_help_wins]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[h_with_trailing_positionals]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[no_args]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[short_h]", + "eval.tests.test_cli_main.test_help_prints_usage_on_stderr_and_exits_zero[v_then_h_help_wins]", + "eval.tests.test_cli_main.test_init_creates_example_grift_file", + "eval.tests.test_cli_main.test_init_overwrites_existing_example_go", + "eval.tests.test_cli_main.test_init_preserves_existing_grift_files", + "eval.tests.test_cli_main.test_init_with_trailing_args_still_scaffolds", + "eval.tests.test_cli_main.test_jim_subcommand_prints_ascii_tribute", + "eval.tests.test_cli_main.test_unknown_flag_reports_undefined_and_exits_nonzero[combined_vh]", + "eval.tests.test_cli_main.test_unknown_flag_reports_undefined_and_exits_nonzero[double_dash_unknown]", + "eval.tests.test_cli_main.test_unknown_flag_reports_undefined_and_exits_nonzero[single_dash_unknown]", + "eval.tests.test_cli_main.test_unknown_flag_reports_undefined_and_exits_nonzero[unknown_with_value]", + "eval.tests.test_cli_main.test_unknown_subcommand_falls_through_to_run", + "eval.tests.test_cli_main.test_version_prints_version_on_stdout_and_exits_zero[double_dash_v]", + "eval.tests.test_cli_main.test_version_prints_version_on_stdout_and_exits_zero[short_v]", + "eval.tests.test_cli_main.test_version_prints_version_on_stdout_and_exits_zero[v_explicit_true]", + "eval.tests.test_cli_main.test_version_prints_version_on_stdout_and_exits_zero[v_then_positionals]", + "eval.tests.test_cli_main.test_version_prints_version_on_stdout_and_exits_zero[v_true_then_positionals]", + "eval.tests.test_cli_main.test_version_string_is_exact" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_module03_run.test_double_dash_help_uses_flag_parser", + "eval.tests.test_module03_run.test_grifter_dir_not_preexisting_and_repeated_runs_stay_clean", + "eval.tests.test_module03_run.test_grifter_dir_removed_after_run[db:seed]", + "eval.tests.test_module03_run.test_grifter_dir_removed_after_run[hello]", + "eval.tests.test_module03_run.test_grifter_dir_removed_after_run[no_such_task]", + "eval.tests.test_module03_run.test_grifter_dir_removed_after_successful_task", + "eval.tests.test_module03_run.test_help_text_on_stdout[cli_args0-grift [task arguments]]", + "eval.tests.test_module03_run.test_help_text_on_stdout[cli_args1-grift [task arguments]]", + "eval.tests.test_module03_run.test_help_text_on_stdout[cli_args2-grift [task arguments]]", + "eval.tests.test_module03_run.test_run_bare_namespace_is_not_a_task[db]", + "eval.tests.test_module03_run.test_run_bare_namespace_is_not_a_task[env]", + "eval.tests.test_module03_run.test_run_from_nested_directory", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args0-Hello World! []]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args1-Hello World! [one]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args2-Hello World! [one two]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args3-Hello World! [one two three]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args4-Hello World! [42]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args5-Hello World! [true false null]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args6-Hello World! [a b c=d]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args7-Hello World! [--foo]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args8-Hello World! [--second=value]]", + "eval.tests.test_module03_run.test_run_hello_forwards_task_args[args9-Hello World! [-]]", + "eval.tests.test_module03_run.test_run_namespace_task_forwards_args[args0-Seeding DB []]", + "eval.tests.test_module03_run.test_run_namespace_task_forwards_args[args1-Seeding DB [users]]", + "eval.tests.test_module03_run.test_run_namespace_task_forwards_args[args2-Seeding DB [users roles]]", + "eval.tests.test_module03_run.test_run_namespace_task_forwards_args[args3-Seeding DB [my table]]", + "eval.tests.test_module03_run.test_run_unknown_task_fails_with_message[dashes-and-dots_123]", + "eval.tests.test_module03_run.test_run_unknown_task_fails_with_message[db:nope]", + "eval.tests.test_module03_run.test_run_unknown_task_fails_with_message[doesNotExist123]", + "eval.tests.test_module03_run.test_run_unknown_task_fails_with_message[no_such_task]", + "eval.tests.test_module03_run.test_unknown_flag_is_rejected", + "eval.tests.test_module03_run.test_version_flag_prints_version[cli_args0]", + "eval.tests.test_module03_run.test_version_flag_prints_version[cli_args1]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_flags.test_combined_short_flags_is_undefined", + "eval.tests.test_flags.test_double_dash_h_equal_true_folds_to_help", + "eval.tests.test_flags.test_double_dash_h_folds_to_help", + "eval.tests.test_flags.test_double_dash_v_equal_true_folds_to_version", + "eval.tests.test_flags.test_double_dash_v_folds_to_version", + "eval.tests.test_flags.test_empty_value_for_help_is_parse_error", + "eval.tests.test_flags.test_empty_value_for_version_is_parse_error", + "eval.tests.test_flags.test_help_and_version_both_equal_true_help_wins", + "eval.tests.test_flags.test_help_equal_false_alone_falls_through_panic", + "eval.tests.test_flags.test_help_equal_false_then_version_prints_version", + "eval.tests.test_flags.test_help_equal_true_prints_usage", + "eval.tests.test_flags.test_help_equal_true_then_jim_positional", + "eval.tests.test_flags.test_jim_then_help_and_version_flags_are_positionals", + "eval.tests.test_flags.test_jim_then_help_equal_true_value_is_positional", + "eval.tests.test_flags.test_jim_then_longfold_version_value_is_positional", + "eval.tests.test_flags.test_jim_then_version_flag_is_positional", + "eval.tests.test_flags.test_version_equal_false_alone_falls_through_panic", + "eval.tests.test_flags.test_version_equal_true_help_equal_false", + "eval.tests.test_flags.test_version_equal_true_prints_version", + "eval.tests.test_flags.test_version_then_help_equal_true_prints_help", + "eval.tests.test_help.test_dash_h_alone_no_flag_dump", + "eval.tests.test_help.test_dash_h_exact_usage", + "eval.tests.test_help.test_dash_h_prints_usage_to_stderr", + "eval.tests.test_help.test_dash_h_with_positional_and_flags_combo", + "eval.tests.test_help.test_dash_h_with_positional_prints_usage", + "eval.tests.test_help.test_double_dash_help_is_flag_error_path", + "eval.tests.test_help.test_double_dash_help_not_the_short_usage_line", + "eval.tests.test_help.test_double_dash_help_usage_flags_listed", + "eval.tests.test_help.test_help_takes_precedence_over_version_ordering_hv", + "eval.tests.test_help.test_help_takes_precedence_over_version_ordering_vh", + "eval.tests.test_help.test_long_version_flag_undefined", + "eval.tests.test_help.test_no_args_not_on_stdout", + "eval.tests.test_help.test_no_args_prints_usage_to_stderr", + "eval.tests.test_help.test_no_args_usage_exact_text", + "eval.tests.test_help.test_unknown_flag_prints_usage", + "eval.tests.test_help.test_unknown_flag_reports_error", + "eval.tests.test_help.test_unknown_long_flag_reports_error", + "eval.tests.test_io.test_help_stderr_vs_version_stdout_separate", + "eval.tests.test_io.test_help_usage_never_on_stdout", + "eval.tests.test_io.test_hv_help_on_stderr_no_stdout", + "eval.tests.test_io.test_stdin_does_not_block_no_args", + "eval.tests.test_io.test_stdin_does_not_leak_into_help", + "eval.tests.test_io.test_stdin_does_not_leak_into_version", + "eval.tests.test_io.test_stdin_empty_input_still_dispatch", + "eval.tests.test_io.test_version_is_not_on_stderr", + "eval.tests.test_io.test_version_on_stdout_exact", + "eval.tests.test_io.test_version_semver_shape", + "eval.tests.test_io.test_version_with_jim_word_still_prints_version", + "eval.tests.test_io.test_version_with_positional_still_prints_version", + "eval.tests.test_io.test_vh_help_on_stderr_no_stdout", + "eval.tests.test_jim.test_jim_after_double_dash_separator", + "eval.tests.test_jim.test_jim_art_leading_m_run_width", + "eval.tests.test_jim.test_jim_art_top_row_is_pure_ms", + "eval.tests.test_jim.test_jim_counts_names", + "eval.tests.test_jim.test_jim_golden_is_stable_shape", + "eval.tests.test_jim.test_jim_ignores_extra_args", + "eval.tests.test_jim.test_jim_ignores_single_arg", + "eval.tests.test_jim.test_jim_ignores_stdin_input", + "eval.tests.test_jim.test_jim_is_deterministic_across_runs", + "eval.tests.test_jim.test_jim_is_not_help_output", + "eval.tests.test_jim.test_jim_kindest_generous_phrase", + "eval.tests.test_jim.test_jim_matches_golden_exact", + "eval.tests.test_jim.test_jim_mentions_jim_weirich_tribute", + "eval.tests.test_jim.test_jim_mentions_rakefork", + "eval.tests.test_jim.test_jim_mentions_wikipedia_link", + "eval.tests.test_jim.test_jim_output_starts_with_blank_then_art", + "eval.tests.test_jim.test_jim_writes_nothing_to_stderr", + "eval.tests.test_jim.test_jim_writes_stdout_nonempty" + ] + } + }, + "commit": "416fdcd6c9961fcede9f39103647224e0d2d937a", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.3121773564397787, + "eval_clean_hashes": [ + "7dd7a1e917c2f31ab929f54b5d28e3cbb5697dbdd1b4ec9030aeb01f1ce895ed" + ], + "input_record": { + "commit": "416fdcd6c9961fcede9f39103647224e0d2d937a", + "commits": 81, + "contributors": 10, + "difficulty": "easy", + "difficulty_code_lines": 684, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 684, + "difficulty_runtime_deps": 2, + "difficulty_score": 1.3121773564397787, + "difficulty_test_code_lines": 370, + "full_name": "markbates/grift", + "github_stars": 437, + "input_joern_zip": "go_joern/markbates__grift.zip", + "joern_status": true, + "joern_time": 14.708798896055669, + "language": "go", + "pb_match": [ + { + "pb_fullname": "naggie/dstask", + "rank": 62, + "similarity": 0.5835608243942261 + } + ], + "repo_age": 9.79, + "repo_path": "go/markbates__grift", + "source": "commit:416fdcd6c9961fcede9f39103647224e0d2d937a", + "status": "done", + "url": "https://github.com/markbates/grift" + }, + "instance_id": "markbates__grift.416fdcd", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "markbates/grift" +} diff --git a/markbates--grift.416fdcd/tests/test.sh b/markbates--grift.416fdcd/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/markbates--grift.416fdcd/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/markbates--grift.416fdcd/tests/workspace.tar.gz b/markbates--grift.416fdcd/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bf4c6a20501699c788eb473e190211722e76046f --- /dev/null +++ b/markbates--grift.416fdcd/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b351273e3cb916692ce246e45ad1e3653fa4f063a88baa87b06ca7b00f10c2b +size 1404 diff --git a/martinmoene--lest.60b1993/environment/Dockerfile b/martinmoene--lest.60b1993/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cd042aa1c8902da43f5e168d272841107895d27b --- /dev/null +++ b/martinmoene--lest.60b1993/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/martinmoene--lest.60b1993/environment/docker-compose.yaml b/martinmoene--lest.60b1993/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinmoene--lest.60b1993/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinmoene--lest.60b1993/environment/download.sh b/martinmoene--lest.60b1993/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..11c3f3bf60c5aa85bf307f6dc69e6dfb69379d7c --- /dev/null +++ b/martinmoene--lest.60b1993/environment/download.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# +# download.sh -- ProgramGym networked download stage for martinmoene/lest. +# +# lest is a header-only C++11 unit-test framework. The selected target, +# example/05-select.cpp, depends only on the repository's own single public +# header include/lest/lest.hpp and on a standard C++11 compiler. The base +# image already ships gcc/g++ 13.3.0, cmake 3.31.12, make and the standard +# library, so no third-party packages or archives are required for this build. +# +# This script only verifies the toolchain and exports the environment that +# build.sh relies on. It performs no compilation, linking, testing or +# packaging. It is designed to be executed as: source /source_ro/download.sh +# +# It expects to be run from the repository root (cwd == repository root) but +# intentionally reads no repository build files: every piece of dependency +# information is written explicitly below. + +set -u + +# Fail safely whether this file is sourced or executed. +fail() { + echo "download.sh: ERROR: $*" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Ensure we run from the repository root so that relative build paths resolve. +# We determine the repository root as the directory of this script when +# executed, or fall back to the current working directory when sourced. +case "${BASH_SOURCE[0]}" in + "" ) + LEST_DOWNLOAD_ROOT="$(pwd)" + ;; + * ) + LEST_DOWNLOAD_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + ;; +esac +export LEST_DOWNLOAD_ROOT + +# The example needs only the repository's own headers and a C++ compiler. +# No additional system packages are required for the selected target, so the +# network download stage is a toolchain-and-environment check only. + +for tool in g++ gcc cmake make; do + if ! command -v "$tool"; then + fail "required tool '$tool' is not available" + fi +done + +# Export the compiler selection and standards flags used by build.sh. +export CXX="${CXX:-g++}" +export CC="${CC:-gcc}" + +# The offline runtime ships an older libstdc++ than the g++ 13 toolchain this +# build produces. Static-linking the C++/gcc runtimes keeps ./executable +# self-contained (no GLIBCXX dependency on the container's libstdc++.so.6). +export CXXFLAGS_FOR_BUILD="-static-libstdc++ -static-libgcc" + +# The target is compiled as C++11 against the repository's include directory. +export LEST_CXX_STD="-std=c++11" +export LEST_INCLUDE_DIR="-I${LEST_DOWNLOAD_ROOT}/include" + +echo "download.sh: toolchain verified (CXX=$CXX); no external dependencies required." diff --git a/martinmoene--lest.60b1993/environment/executable b/martinmoene--lest.60b1993/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..e33c26cdb8ac6db2d544575a1e5c6c21ab484c71 --- /dev/null +++ b/martinmoene--lest.60b1993/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a348dece4814a269d9b2a056106d986c180a975ab17dd945fe81e8530bad5f0 +size 3007192 diff --git a/martinmoene--lest.60b1993/environment/harbor_configure_apt_mirror.sh b/martinmoene--lest.60b1993/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinmoene--lest.60b1993/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinmoene--lest.60b1993/environment/harbor_prepare_download_env.sh b/martinmoene--lest.60b1993/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinmoene--lest.60b1993/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinmoene--lest.60b1993/environment/workspace.tar.gz b/martinmoene--lest.60b1993/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b120d83928176784192af4fff4a6bd7579f69528 --- /dev/null +++ b/martinmoene--lest.60b1993/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a65efa47bc6773aaa9172adb021ba402b005d94dfb550efa03f1ae9f1e5c5c3 +size 11683 diff --git a/martinmoene--lest.60b1993/instruction.md b/martinmoene--lest.60b1993/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/martinmoene--lest.60b1993/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/martinmoene--lest.60b1993/solution/solve.sh b/martinmoene--lest.60b1993/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/martinmoene--lest.60b1993/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/martinmoene--lest.60b1993/task.toml b/martinmoene--lest.60b1993/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..0cfd331f12fbd2fb010016ac41028945c69d28e6 --- /dev/null +++ b/martinmoene--lest.60b1993/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/martinmoene--lest.60b1993" +description = "Synthetic ProgramGym cleanroom reconstruction task for martinmoene/lest" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "martinmoene__lest.60b1993" +repository = "martinmoene/lest" +commit = "60b19931a23b562905b32762aefc6fa9155aab5a" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.696356388733332 +test_branches = 4 +test_count = 586 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/martinmoene--lest.60b1993/tests/Dockerfile b/martinmoene--lest.60b1993/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ae6071510c9375ad35caf40d5f0fc02507509a77 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_01.tar.gz b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a71441d655ce5200378459b2eb65fa575d727080 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa56c4c6b206c89c4df6a221abe87105ee632843511f2ac7315d048184d0f46f +size 19069 diff --git a/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_02.tar.gz b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..95787045338082a26532561b5464e6e3f2b6babb --- /dev/null +++ b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9809c7fcc139106e245438ce10629ea5bf056f01a089da643abf9355c3db25ca +size 8926 diff --git a/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_03.tar.gz b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..095a91e44b866e30de80a777b4a29a49ea1c4f92 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a33fc04278170b1a50a9dc286bf85d18176f93cbbf4b53483725ed9bfecfce8 +size 19254 diff --git a/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_04.tar.gz b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9243b76ea531edfd99af56f3722ecb2caf5660b0 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9285125355f705face7b84846e010be9e367828425dde715fea9c2af24649d7c +size 25237 diff --git a/martinmoene--lest.60b1993/tests/docker-compose.yaml b/martinmoene--lest.60b1993/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinmoene--lest.60b1993/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinmoene--lest.60b1993/tests/download.sh b/martinmoene--lest.60b1993/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..11c3f3bf60c5aa85bf307f6dc69e6dfb69379d7c --- /dev/null +++ b/martinmoene--lest.60b1993/tests/download.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# +# download.sh -- ProgramGym networked download stage for martinmoene/lest. +# +# lest is a header-only C++11 unit-test framework. The selected target, +# example/05-select.cpp, depends only on the repository's own single public +# header include/lest/lest.hpp and on a standard C++11 compiler. The base +# image already ships gcc/g++ 13.3.0, cmake 3.31.12, make and the standard +# library, so no third-party packages or archives are required for this build. +# +# This script only verifies the toolchain and exports the environment that +# build.sh relies on. It performs no compilation, linking, testing or +# packaging. It is designed to be executed as: source /source_ro/download.sh +# +# It expects to be run from the repository root (cwd == repository root) but +# intentionally reads no repository build files: every piece of dependency +# information is written explicitly below. + +set -u + +# Fail safely whether this file is sourced or executed. +fail() { + echo "download.sh: ERROR: $*" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +} + +# Ensure we run from the repository root so that relative build paths resolve. +# We determine the repository root as the directory of this script when +# executed, or fall back to the current working directory when sourced. +case "${BASH_SOURCE[0]}" in + "" ) + LEST_DOWNLOAD_ROOT="$(pwd)" + ;; + * ) + LEST_DOWNLOAD_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + ;; +esac +export LEST_DOWNLOAD_ROOT + +# The example needs only the repository's own headers and a C++ compiler. +# No additional system packages are required for the selected target, so the +# network download stage is a toolchain-and-environment check only. + +for tool in g++ gcc cmake make; do + if ! command -v "$tool"; then + fail "required tool '$tool' is not available" + fi +done + +# Export the compiler selection and standards flags used by build.sh. +export CXX="${CXX:-g++}" +export CC="${CC:-gcc}" + +# The offline runtime ships an older libstdc++ than the g++ 13 toolchain this +# build produces. Static-linking the C++/gcc runtimes keeps ./executable +# self-contained (no GLIBCXX dependency on the container's libstdc++.so.6). +export CXXFLAGS_FOR_BUILD="-static-libstdc++ -static-libgcc" + +# The target is compiled as C++11 against the repository's include directory. +export LEST_CXX_STD="-std=c++11" +export LEST_INCLUDE_DIR="-I${LEST_DOWNLOAD_ROOT}/include" + +echo "download.sh: toolchain verified (CXX=$CXX); no external dependencies required." diff --git a/martinmoene--lest.60b1993/tests/executable b/martinmoene--lest.60b1993/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..e33c26cdb8ac6db2d544575a1e5c6c21ab484c71 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a348dece4814a269d9b2a056106d986c180a975ab17dd945fe81e8530bad5f0 +size 3007192 diff --git a/martinmoene--lest.60b1993/tests/harbor_configure_apt_mirror.sh b/martinmoene--lest.60b1993/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinmoene--lest.60b1993/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinmoene--lest.60b1993/tests/harbor_prepare_download_env.sh b/martinmoene--lest.60b1993/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinmoene--lest.60b1993/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinmoene--lest.60b1993/tests/programgym_evaluator.py b/martinmoene--lest.60b1993/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/martinmoene--lest.60b1993/tests/programgym_task.json b/martinmoene--lest.60b1993/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..4ac0a15ab72e5e89d982ec5e2ccb29c8331111fe --- /dev/null +++ b/martinmoene--lest.60b1993/tests/programgym_task.json @@ -0,0 +1,708 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_errors.test_count_beats_list_when_both_set", + "eval.tests.test_errors.test_double_dash_ends_options", + "eval.tests.test_errors.test_double_dash_then_option_flag_is_spec", + "eval.tests.test_errors.test_error_variant_prints_the_offending_token", + "eval.tests.test_errors.test_help_takes_precedence_over_suite_error", + "eval.tests.test_errors.test_invalid_order_value_is_error", + "eval.tests.test_errors.test_option_after_positional_is_spec_not_option", + "eval.tests.test_errors.test_options_before_spec_still_apply", + "eval.tests.test_errors.test_repeat_negative_other_than_minus_one_is_error", + "eval.tests.test_errors.test_repeat_non_numeric_parses_as_zero", + "eval.tests.test_errors.test_repeat_zero_valid", + "eval.tests.test_errors.test_scan_of_combined_short_flags_is_single_tokens", + "eval.tests.test_errors.test_seed_empty_value_means_zero", + "eval.tests.test_errors.test_seed_large_number_accepted", + "eval.tests.test_errors.test_seed_negative_leading_dash_parsed_as_option", + "eval.tests.test_errors.test_seed_non_numeric_is_error", + "eval.tests.test_errors.test_unrecognised_option_error_on_stdout", + "eval.tests.test_errors.test_unrecognised_option_is_error", + "eval.tests.test_errors.test_unrecognised_short_option_is_error", + "eval.tests.test_help_version.test_help_documents_selection_specs", + "eval.tests.test_help_version.test_help_lists_every_option_short_and_long", + "eval.tests.test_help_version.test_help_option_value_separator_alias", + "eval.tests.test_help_version.test_help_short_flag_h_matches_long", + "eval.tests.test_help_version.test_help_shows_exact_usage", + "eval.tests.test_help_version.test_help_writes_to_stdout_not_stderr", + "eval.tests.test_help_version.test_help_yields_usage_with_repeat_indefinite", + "eval.tests.test_help_version.test_version_links_to_github", + "eval.tests.test_help_version.test_version_only_runs_without_suite", + "eval.tests.test_help_version.test_version_reports_full_banner", + "eval.tests.test_help_version.test_version_reports_lest_version", + "eval.tests.test_help_version.test_version_writes_to_stdout", + "eval.tests.test_mode_precedence.test_abort_applies_to_time_mode", + "eval.tests.test_mode_precedence.test_abort_ignored_by_count", + "eval.tests.test_mode_precedence.test_abort_ignored_by_list_tests", + "eval.tests.test_mode_precedence.test_count_beats_time", + "eval.tests.test_mode_precedence.test_count_ignores_repeat", + "eval.tests.test_mode_precedence.test_count_mode_exits_zero_despite_failures", + "eval.tests.test_mode_precedence.test_help_beats_version", + "eval.tests.test_mode_precedence.test_list_tags_mode_exits_zero_despite_failures", + "eval.tests.test_mode_precedence.test_list_tests_beats_list_tags", + "eval.tests.test_mode_precedence.test_list_tests_beats_time", + "eval.tests.test_mode_precedence.test_list_tests_mode_exits_zero_despite_failures", + "eval.tests.test_mode_precedence.test_seed_ignored_when_order_declared", + "eval.tests.test_mode_precedence.test_time_mode_ordered_declared_lines", + "eval.tests.test_mode_precedence.test_time_mode_surfaces_failure_count_as_exit_code", + "eval.tests.test_mode_precedence.test_time_random_fixed_seed_is_full_permutation", + "eval.tests.test_mode_precedence.test_time_repeat_three_does_not_multiply_lines", + "eval.tests.test_mode_precedence.test_time_repeat_two_does_not_multiply_lines", + "eval.tests.test_mode_precedence.test_time_with_spec_subset_reports_only_matches", + "eval.tests.test_mode_precedence.test_version_beats_count", + "eval.tests.test_options.test_abort_exit_code_is_failures_so_far", + "eval.tests.test_options.test_abort_reports_summary_of_selected_pool", + "eval.tests.test_options.test_abort_short_flag", + "eval.tests.test_options.test_abort_stops_at_first_failure", + "eval.tests.test_options.test_count_does_not_run_tests", + "eval.tests.test_options.test_count_reports_total", + "eval.tests.test_options.test_count_scoped_to_plural_spec", + "eval.tests.test_options.test_count_scoped_to_selected", + "eval.tests.test_options.test_count_scoped_to_tuple_spec", + "eval.tests.test_options.test_count_short_flag", + "eval.tests.test_options.test_list_tags_empty_for_untagged_suite", + "eval.tests.test_options.test_list_tags_short_flag", + "eval.tests.test_options.test_list_tests_does_not_execute_behaviour", + "eval.tests.test_options.test_list_tests_exit_zero", + "eval.tests.test_options.test_list_tests_lists_all_in_declared_order", + "eval.tests.test_options.test_list_tests_respects_spec", + "eval.tests.test_options.test_list_tests_short_flag", + "eval.tests.test_options.test_pass_does_not_hide_failures", + "eval.tests.test_options.test_pass_produces_all_passed_summary", + "eval.tests.test_options.test_pass_reports_passing_with_decomposition", + "eval.tests.test_options.test_pass_short_flag", + "eval.tests.test_options.test_pass_zen_implies_pass", + "eval.tests.test_options.test_pass_zen_omits_decomposition", + "eval.tests.test_options.test_pass_zen_short_flag", + "eval.tests.test_options.test_time_can_run_failing_tests", + "eval.tests.test_options.test_time_reports_elapsed_total", + "eval.tests.test_options.test_time_reports_ms_lines", + "eval.tests.test_options.test_time_short_flag", + "eval.tests.test_options.test_verbose_accepted", + "eval.tests.test_options.test_verbose_with_pass_adds_section_context", + "eval.tests.test_options.test_zen_reports_expecting_checks_without_expansion", + "eval.tests.test_order_repeat.test_default_order_is_declared", + "eval.tests.test_order_repeat.test_order_and_repeat_combine", + "eval.tests.test_order_repeat.test_order_declared_explicit", + "eval.tests.test_order_repeat.test_order_lexical_deterministic", + "eval.tests.test_order_repeat.test_order_lexical_sorts_names", + "eval.tests.test_order_repeat.test_order_random_fixed_seed_is_permutation", + "eval.tests.test_order_repeat.test_order_random_reorders_suite", + "eval.tests.test_order_repeat.test_order_random_seed_one_differs_from_seed_two", + "eval.tests.test_order_repeat.test_order_random_with_fixed_seed_is_deterministic", + "eval.tests.test_order_repeat.test_random_run_still_has_same_failure_total", + "eval.tests.test_order_repeat.test_random_seed_time_accepted", + "eval.tests.test_order_repeat.test_random_seed_zero_acceptable", + "eval.tests.test_order_repeat.test_repeat_default_is_one", + "eval.tests.test_order_repeat.test_repeat_three_counts_three", + "eval.tests.test_order_repeat.test_repeat_two_runs_failing_test_twice", + "eval.tests.test_order_repeat.test_repeat_with_pass_counts_pass_runs", + "eval.tests.test_order_repeat.test_repeat_zero_runs_none", + "eval.tests.test_parse_edges.test_clustered_short_flags_rejected", + "eval.tests.test_parse_edges.test_combined_order_random_report_summary", + "eval.tests.test_parse_edges.test_count_flag_ignores_embedded_value", + "eval.tests.test_parse_edges.test_help_flag_ignores_embedded_value", + "eval.tests.test_parse_edges.test_lexical_then_random_differs_from_lexical", + "eval.tests.test_parse_edges.test_lexical_then_random_yields_sort_then_shuffle", + "eval.tests.test_parse_edges.test_order_declared_with_extra_part_is_error", + "eval.tests.test_parse_edges.test_order_empty_value_is_error", + "eval.tests.test_parse_edges.test_order_without_value_is_error", + "eval.tests.test_parse_edges.test_plain_random_differs_from_sort_then_shuffle", + "eval.tests.test_parse_edges.test_plain_random_seed_zero_is_deterministic", + "eval.tests.test_parse_edges.test_random_seed_empty_value_is_zero", + "eval.tests.test_parse_edges.test_random_seed_without_value_is_zero", + "eval.tests.test_parse_edges.test_random_then_lexical_still_random", + "eval.tests.test_parse_edges.test_repeat_empty_value_runs_zero", + "eval.tests.test_parse_edges.test_repeat_without_value_runs_zero", + "eval.tests.test_parse_edges.test_single_dash_is_error", + "eval.tests.test_parse_edges.test_version_flag_ignores_embedded_value", + "eval.tests.test_reports_io.test_abort_with_pass_reports_prior_pass_then_stops", + "eval.tests.test_reports_io.test_all_modes_write_only_stdout", + "eval.tests.test_reports_io.test_count_and_list_precedence_regardless_of_order", + "eval.tests.test_reports_io.test_error_messages_appear_on_stdout", + "eval.tests.test_reports_io.test_failure_lines_appear_on_stdout", + "eval.tests.test_reports_io.test_pass_reports_got_exception_success_kinds", + "eval.tests.test_reports_io.test_pass_reports_three_expectations", + "eval.tests.test_reports_io.test_pass_reports_two_captured_tests", + "eval.tests.test_reports_io.test_pass_zen_reports_same_count_without_expansion", + "eval.tests.test_reports_io.test_time_mode_stdout_shape", + "eval.tests.test_reports_io.test_time_with_pass_reports_passing_checks", + "eval.tests.test_run_default.test_default_report_order_is_declared", + "eval.tests.test_run_default.test_failing_subset_summary_count_matches", + "eval.tests.test_run_default.test_four_distinct_failures_reported", + "eval.tests.test_run_default.test_lexical_failure_reported", + "eval.tests.test_run_default.test_missing_expected_exception_reported", + "eval.tests.test_run_default.test_missing_typed_exception_reported", + "eval.tests.test_run_default.test_no_args_exit_code_equals_failure_count", + "eval.tests.test_run_default.test_no_args_output_on_stdout_only", + "eval.tests.test_run_default.test_no_args_runs_all_tests", + "eval.tests.test_run_default.test_single_failure_exit_code_one", + "eval.tests.test_run_default.test_single_passing_test_exit_zero_no_summary", + "eval.tests.test_run_default.test_successful_expectations_not_reported_by_default", + "eval.tests.test_run_default.test_summary_uses_singular_plural", + "eval.tests.test_run_default.test_unexpected_exception_message_reported", + "eval.tests.test_selection.test_at_sign_selects_all_tests", + "eval.tests.test_selection.test_case_insensitive_partial_word", + "eval.tests.test_selection.test_empty_string_spec_selects_all", + "eval.tests.test_selection.test_exclamation_excludes_matching", + "eval.tests.test_selection.test_exclusion_of_all_failing_tests_selects_passers_only", + "eval.tests.test_selection.test_exclusion_of_everything_selects_zero", + "eval.tests.test_selection.test_exclusion_removes_single_failing_test", + "eval.tests.test_selection.test_hidden_dot_selector_treated_as_text", + "eval.tests.test_selection.test_include_then_exclude_combination", + "eval.tests.test_selection.test_multiple_specs_union_matches", + "eval.tests.test_selection.test_spec_matching_pass_and_fail_tests", + "eval.tests.test_selection.test_spec_matching_passing_test_only_passes", + "eval.tests.test_selection.test_spec_that_matches_nothing", + "eval.tests.test_selection.test_star_selects_all_tests", + "eval.tests.test_selection.test_text_spec_is_case_insensitive", + "eval.tests.test_selection.test_text_spec_selects_matching_tests" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_lest_decompose.test_abort_reports_partial_out_of", + "eval.tests.test_lest_decompose.test_abort_shorthand_a", + "eval.tests.test_lest_decompose.test_abort_stops_at_first_failure", + "eval.tests.test_lest_decompose.test_abort_with_pass_reports_first_failure_only", + "eval.tests.test_lest_decompose.test_all_passed_summary_plural", + "eval.tests.test_lest_decompose.test_all_passed_summary_singular", + "eval.tests.test_lest_decompose.test_all_spec_at_sign_selects_all", + "eval.tests.test_lest_decompose.test_all_spec_star_selects_all", + "eval.tests.test_lest_decompose.test_all_spec_then_omit_spec", + "eval.tests.test_lest_decompose.test_captured_exception_passes_specific_type", + "eval.tests.test_lest_decompose.test_captured_exception_passes_unspecified", + "eval.tests.test_lest_decompose.test_combined_short_options_unsupported", + "eval.tests.test_lest_decompose.test_count_case_variants_across_specs", + "eval.tests.test_lest_decompose.test_count_default_reports_seven", + "eval.tests.test_lest_decompose.test_count_ignores_repeat_value", + "eval.tests.test_lest_decompose.test_count_mode_ignores_abort_switch", + "eval.tests.test_lest_decompose.test_count_unaffected_by_lexical_order", + "eval.tests.test_lest_decompose.test_count_with_subset", + "eval.tests.test_lest_decompose.test_default_run_exit_code_counts_failures", + "eval.tests.test_lest_decompose.test_default_run_reports_four_specific_failures", + "eval.tests.test_lest_decompose.test_default_run_stdout_carries_output_stderr_empty", + "eval.tests.test_lest_decompose.test_empty_spec_selects_non_hidden", + "eval.tests.test_lest_decompose.test_error_branch_uses_stdout_not_stderr", + "eval.tests.test_lest_decompose.test_exception_failure_summary_counts_two", + "eval.tests.test_lest_decompose.test_expected_exception_missing_specific_type", + "eval.tests.test_lest_decompose.test_expected_exception_missing_unspecified", + "eval.tests.test_lest_decompose.test_failure_summary_default_uses_all_seven", + "eval.tests.test_lest_decompose.test_failure_summary_uses_selected_count", + "eval.tests.test_lest_decompose.test_help_ignores_trailing_test_spec", + "eval.tests.test_lest_decompose.test_help_lists_end_option_and_spec_rules", + "eval.tests.test_lest_decompose.test_help_lists_option_inventory", + "eval.tests.test_lest_decompose.test_help_shorthand_h_matches_long", + "eval.tests.test_lest_decompose.test_help_usage_exits_zero", + "eval.tests.test_lest_decompose.test_help_uses_stdout_and_exits_zero", + "eval.tests.test_lest_decompose.test_invalid_random_seed_reports_error", + "eval.tests.test_lest_decompose.test_list_shorthand_flag", + "eval.tests.test_lest_decompose.test_list_tags_empty", + "eval.tests.test_lest_decompose.test_list_tags_ignores_spec_when_no_tags_exist", + "eval.tests.test_lest_decompose.test_list_tests_default", + "eval.tests.test_lest_decompose.test_list_tests_honors_omit_spec", + "eval.tests.test_lest_decompose.test_list_tests_honors_spec", + "eval.tests.test_lest_decompose.test_list_tests_nonmatching_yields_empty_list", + "eval.tests.test_lest_decompose.test_multiple_omit_specs_union", + "eval.tests.test_lest_decompose.test_multiple_specs_or_combined", + "eval.tests.test_lest_decompose.test_nonmatching_spec_selects_zero", + "eval.tests.test_lest_decompose.test_omit_spec_excludes_matching", + "eval.tests.test_lest_decompose.test_option_terminator_allows_exact_spec_word", + "eval.tests.test_lest_decompose.test_option_terminator_double_dash", + "eval.tests.test_lest_decompose.test_order_declared_is_default", + "eval.tests.test_lest_decompose.test_order_lexical_sorts_list", + "eval.tests.test_lest_decompose.test_pass_does_not_suppress_failures", + "eval.tests.test_lest_decompose.test_pass_expansion_renders_integer_equality_operands", + "eval.tests.test_lest_decompose.test_pass_expansion_renders_negated_less_than", + "eval.tests.test_lest_decompose.test_pass_shorthand_p_matches_long", + "eval.tests.test_lest_decompose.test_pass_zen_captured_exceptions_have_no_expansion", + "eval.tests.test_lest_decompose.test_pass_zen_shorthand_z_matches_long", + "eval.tests.test_lest_decompose.test_pass_zen_still_expands_failures", + "eval.tests.test_lest_decompose.test_pass_zen_suppresses_expansion_on_passing_tests", + "eval.tests.test_lest_decompose.test_random_changes_order", + "eval.tests.test_lest_decompose.test_random_different_seeds_differ", + "eval.tests.test_lest_decompose.test_random_order_affects_report_sequence", + "eval.tests.test_lest_decompose.test_random_seed_time_is_valid", + "eval.tests.test_lest_decompose.test_random_seed_zero_is_valid_order", + "eval.tests.test_lest_decompose.test_random_with_fixed_seed_is_deterministic", + "eval.tests.test_lest_decompose.test_repeat_multiplies_selected_tests", + "eval.tests.test_lest_decompose.test_repeat_one_equals_default_selection", + "eval.tests.test_lest_decompose.test_repeat_two_on_passing_suite_exits_zero", + "eval.tests.test_lest_decompose.test_repeat_zero_selects_zero_tests", + "eval.tests.test_lest_decompose.test_string_comparison_renders_quoted_operands", + "eval.tests.test_lest_decompose.test_string_decomposition_uses_quotes", + "eval.tests.test_lest_decompose.test_text_selection_case_insensitive", + "eval.tests.test_lest_decompose.test_text_selection_count[Empty-1 selected test]", + "eval.tests.test_lest_decompose.test_text_selection_count[captured-2 selected tests]", + "eval.tests.test_lest_decompose.test_text_selection_count[exception-5 selected tests]", + "eval.tests.test_lest_decompose.test_text_selection_count[lexically-1 selected test]", + "eval.tests.test_lest_decompose.test_text_selection_count[missing-2 selected tests]", + "eval.tests.test_lest_decompose.test_text_selection_count[succeed-1 selected test]", + "eval.tests.test_lest_decompose.test_time_has_no_failure_summary", + "eval.tests.test_lest_decompose.test_time_lists_all_tests", + "eval.tests.test_lest_decompose.test_time_nonmatching_yields_only_elapsed", + "eval.tests.test_lest_decompose.test_time_repeat_does_not_duplicate_duration_list", + "eval.tests.test_lest_decompose.test_time_respects_spec_subset", + "eval.tests.test_lest_decompose.test_time_shorthand_t_matches_long", + "eval.tests.test_lest_decompose.test_time_with_empty_selection_reports_elapsed_only", + "eval.tests.test_lest_decompose.test_unexpected_exception_kind_text", + "eval.tests.test_lest_decompose.test_unexpected_exception_reports_message", + "eval.tests.test_lest_decompose.test_unrecognized_option_errors", + "eval.tests.test_lest_decompose.test_verbose_shorthand_v_matches_long", + "eval.tests.test_lest_decompose.test_verbose_still_reports_failures", + "eval.tests.test_lest_decompose.test_version_ignores_trailing_test_spec", + "eval.tests.test_lest_decompose.test_version_reports_lest", + "eval.tests.test_lest_decompose.test_version_starts_with_banner", + "eval.tests.test_lest_decompose.test_version_uses_stdout_and_exits_zero", + "eval.tests.test_lest_decompose.test_zero_selected_default_run_is_silent", + "eval.tests.test_lest_decompose.test_zero_selected_pass_summary" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_options.test_abort_all_passing_exits_zero", + "eval.tests.test_cli_options.test_abort_stops_at_first_failure_default_order", + "eval.tests.test_cli_options.test_abort_with_single_failing_selector", + "eval.tests.test_cli_options.test_count_ignores_repeat_option", + "eval.tests.test_cli_options.test_count_reports_all_selected_tests", + "eval.tests.test_cli_options.test_count_singular_pluralisation", + "eval.tests.test_cli_options.test_count_takes_precedence_over_list_tests", + "eval.tests.test_cli_options.test_count_with_selector_restricts_selection", + "eval.tests.test_cli_options.test_count_zero_when_no_test_matches", + "eval.tests.test_cli_options.test_help_prints_usage_and_exits_zero", + "eval.tests.test_cli_options.test_help_short_circuits_run_even_with_text_args", + "eval.tests.test_cli_options.test_help_takes_precedence_over_count", + "eval.tests.test_cli_options.test_list_tags_empty_for_untagged_suite", + "eval.tests.test_cli_options.test_list_tests_lists_all_in_declared_order", + "eval.tests.test_cli_options.test_list_tests_short_and_long_flags_match", + "eval.tests.test_cli_options.test_pass_full_run_matches_golden", + "eval.tests.test_cli_options.test_pass_lexically_failing_matches_golden", + "eval.tests.test_cli_options.test_pass_single_passing_match_golden", + "eval.tests.test_cli_options.test_pass_zen_omits_decomposition_expansion", + "eval.tests.test_cli_options.test_pass_zen_reports_failing_case_bare", + "eval.tests.test_cli_options.test_time_reports_all_durations_matches_normalized_golden", + "eval.tests.test_cli_options.test_verbose_is_accepted_and_unchanged_for_this_suite", + "eval.tests.test_cli_options.test_verbose_short_v_flag_does_not_dispatch_to_version", + "eval.tests.test_cli_options.test_version_no_short_flag", + "eval.tests.test_cli_options.test_version_reports_lest_version", + "eval.tests.test_composite_configs.test_abort_over_multiple_passing_selections_is_silent", + "eval.tests.test_composite_configs.test_abort_zero_failure_selection_is_silent", + "eval.tests.test_composite_configs.test_count_bare_bang_is_empty_selection", + "eval.tests.test_composite_configs.test_count_wildcard_minus_captured", + "eval.tests.test_composite_configs.test_count_wildcard_minus_negation", + "eval.tests.test_composite_configs.test_pass_and_abort_compose", + "eval.tests.test_composite_configs.test_pass_zen_full_suite_matches_golden", + "eval.tests.test_composite_configs.test_repeat_is_ignored_by_list_tags", + "eval.tests.test_composite_configs.test_repeat_is_ignored_by_list_tests", + "eval.tests.test_composite_configs.test_time_over_broad_exception_selection", + "eval.tests.test_default_run.test_default_run_failure_lines_carry_test_kind_and_expression", + "eval.tests.test_default_run.test_default_run_reports_each_failing_case", + "eval.tests.test_default_run.test_default_run_reports_only_failing_cases", + "eval.tests.test_default_run.test_default_run_returns_number_of_failures_as_exit_code", + "eval.tests.test_default_run.test_default_run_stdout_matches_golden", + "eval.tests.test_default_run.test_default_run_summary_line_reports_failed_total", + "eval.tests.test_default_run.test_default_run_writes_nothing_to_stderr", + "eval.tests.test_default_run.test_end_of_options_marker_selects_all_tests", + "eval.tests.test_default_run.test_failure_count_exact_at_255", + "eval.tests.test_default_run.test_failure_count_is_truncated_to_byte_by_the_os", + "eval.tests.test_default_run.test_no_matching_selector_runs_no_tests_and_exits_zero", + "eval.tests.test_default_run.test_report_lines_all_reference_05_select_with_line_numbers", + "eval.tests.test_dispatch_precedence.test_count_wins_over_list_tags_and_time", + "eval.tests.test_dispatch_precedence.test_count_wins_over_pass_when_flags_cross", + "eval.tests.test_dispatch_precedence.test_count_with_random_order_reports_full_set", + "eval.tests.test_dispatch_precedence.test_help_wins_over_other_helpers", + "eval.tests.test_dispatch_precedence.test_list_tests_wins_over_time", + "eval.tests.test_dispatch_precedence.test_list_wins_over_tags", + "eval.tests.test_dispatch_precedence.test_pass_zen_crossed_with_pass_still_zen", + "eval.tests.test_dispatch_precedence.test_repeat_reported_by_repetition_not_single_action", + "eval.tests.test_dispatch_precedence.test_time_wins_over_normal_run", + "eval.tests.test_dispatch_precedence.test_version_wins_over_count", + "eval.tests.test_error_paths.test_bad_options_report_exact_golden_error[--bogus]", + "eval.tests.test_error_paths.test_bad_options_report_exact_golden_error[--order=sideways]", + "eval.tests.test_error_paths.test_bad_options_report_exact_golden_error[--random-seed=notanumber]", + "eval.tests.test_error_paths.test_bad_options_report_exact_golden_error[--unknown-option]", + "eval.tests.test_error_paths.test_bad_options_report_exact_golden_error[-q]", + "eval.tests.test_error_paths.test_error_message_goes_to_stdout_not_stderr", + "eval.tests.test_error_paths.test_option_equality_form_with_value", + "eval.tests.test_error_paths.test_repeat_rejects_negative_below_minus_one", + "eval.tests.test_error_paths.test_unrecognised_option_names_the_offender", + "eval.tests.test_error_paths.test_valid_numeric_random_seed_accepted[0]", + "eval.tests.test_error_paths.test_valid_numeric_random_seed_accepted[1234567890]", + "eval.tests.test_error_paths.test_valid_numeric_random_seed_accepted[7]", + "eval.tests.test_option_parsing_boundaries.test_abort_after_positional_is_a_noop_selector", + "eval.tests.test_option_parsing_boundaries.test_count_after_positional_does_not_count", + "eval.tests.test_option_parsing_boundaries.test_double_equals_declared_value_is_rejected", + "eval.tests.test_option_parsing_boundaries.test_double_equals_lexical_value_is_rejected", + "eval.tests.test_option_parsing_boundaries.test_double_equals_random_value_is_rejected", + "eval.tests.test_option_parsing_boundaries.test_empty_order_value_is_an_unrecognised_option", + "eval.tests.test_option_parsing_boundaries.test_failing_case_before_option_like_args_reports_failure", + "eval.tests.test_option_parsing_boundaries.test_leading_zero_seed_matches_seed_zero_permutation", + "eval.tests.test_option_parsing_boundaries.test_list_helper_after_positional_is_a_selector", + "eval.tests.test_option_parsing_boundaries.test_option_like_arg_after_positional_is_a_selector", + "eval.tests.test_option_parsing_boundaries.test_order_value_with_trailing_equals_is_rejected", + "eval.tests.test_option_parsing_boundaries.test_random_seed_rejects_decimal", + "eval.tests.test_option_parsing_boundaries.test_random_seed_rejects_plus_prefixed_number", + "eval.tests.test_option_parsing_boundaries.test_repeat_accepts_decimal_and_truncates", + "eval.tests.test_option_parsing_boundaries.test_repeat_accepts_plus_prefixed_number", + "eval.tests.test_option_parsing_boundaries.test_seed_plus_seven_digits_accepted_without_shuffle", + "eval.tests.test_option_value_edges.test_bare_dash_is_an_unrecognised_option", + "eval.tests.test_option_value_edges.test_bare_order_flag_is_rejected", + "eval.tests.test_option_value_edges.test_bare_random_seed_decodes_to_zero_and_preserves_declared_order", + "eval.tests.test_option_value_edges.test_bare_repeat_decodes_to_zero_empty_run", + "eval.tests.test_option_value_edges.test_combined_short_flags_are_not_supported", + "eval.tests.test_option_value_edges.test_empty_seed_matches_explicit_zero_permutation", + "eval.tests.test_option_value_edges.test_empty_value_random_seed_is_accepted", + "eval.tests.test_option_value_edges.test_empty_value_repeat_decodes_to_zero", + "eval.tests.test_option_value_edges.test_equals_value_on_count_flag_reports_full_and_ignores_value", + "eval.tests.test_option_value_edges.test_equals_value_on_help_flag_is_dropped", + "eval.tests.test_option_value_edges.test_equals_value_on_pass_flag_is_dropped", + "eval.tests.test_option_value_edges.test_negative_random_seed_is_rejected", + "eval.tests.test_option_value_edges.test_non_integral_random_seed_is_rejected", + "eval.tests.test_option_value_edges.test_non_numeric_value_on_count_flag_is_dropped", + "eval.tests.test_option_value_edges.test_zen_over_all_captured_exceptions_matches_golden", + "eval.tests.test_option_value_edges.test_zen_over_broad_exception_selection_matches_golden", + "eval.tests.test_ordering_repeat.test_abort_base_line_unchanged_by_repeat_above_one", + "eval.tests.test_ordering_repeat.test_abort_under_random_order_halts_at_randomized_first_failure", + "eval.tests.test_ordering_repeat.test_abort_under_random_order_second_seed", + "eval.tests.test_ordering_repeat.test_declared_order_flag_cannot_undo_lexical", + "eval.tests.test_ordering_repeat.test_default_order_is_declared", + "eval.tests.test_ordering_repeat.test_different_random_seeds_differ", + "eval.tests.test_ordering_repeat.test_exact_random_order_for_fixed_seed", + "eval.tests.test_ordering_repeat.test_lexical_order_under_substring_selection", + "eval.tests.test_ordering_repeat.test_list_tests_respects_order[declared]", + "eval.tests.test_ordering_repeat.test_list_tests_respects_order[lexical]", + "eval.tests.test_ordering_repeat.test_pass_abort_lexical_stops_at_first_failure", + "eval.tests.test_ordering_repeat.test_pass_over_lexical_order_matches_golden", + "eval.tests.test_ordering_repeat.test_pass_reports_failing_case_per_repetition", + "eval.tests.test_ordering_repeat.test_random_plus_lexical_shuffles_sorted", + "eval.tests.test_ordering_repeat.test_random_seed_changes_order_but_keeps_set[0]", + "eval.tests.test_ordering_repeat.test_random_seed_changes_order_but_keeps_set[1]", + "eval.tests.test_ordering_repeat.test_random_seed_changes_order_but_keeps_set[42]", + "eval.tests.test_ordering_repeat.test_random_seed_changes_order_but_keeps_set[999983]", + "eval.tests.test_ordering_repeat.test_random_seed_ignored_under_declared_order", + "eval.tests.test_ordering_repeat.test_random_seed_is_deterministic_across_runs", + "eval.tests.test_ordering_repeat.test_random_seed_time_is_accepted", + "eval.tests.test_ordering_repeat.test_random_without_seed_is_accepted", + "eval.tests.test_ordering_repeat.test_repeat_composes_with_abort", + "eval.tests.test_ordering_repeat.test_repeat_non_numeric_decodes_to_zero", + "eval.tests.test_ordering_repeat.test_repeat_repeats_a_failing_case", + "eval.tests.test_ordering_repeat.test_repeat_with_pass_summary_counts_repetitions", + "eval.tests.test_ordering_repeat.test_repeat_zero_runs_nothing", + "eval.tests.test_ordering_repeat.test_time_with_repeat_times_single_iteration", + "eval.tests.test_report_format.test_count_negated_reports_reduced_set", + "eval.tests.test_report_format.test_count_wildcards_report_full_set[*]", + "eval.tests.test_report_format.test_count_wildcards_report_full_set[@]", + "eval.tests.test_report_format.test_count_wins_over_pass_in_report_summary[flags0]", + "eval.tests.test_report_format.test_count_wins_over_pass_in_report_summary[flags1]", + "eval.tests.test_report_format.test_failure_summary_plural_tests", + "eval.tests.test_report_format.test_failure_summary_singular_test", + "eval.tests.test_report_format.test_list_tags_subset_is_empty", + "eval.tests.test_report_format.test_pass_summary_plural_tests", + "eval.tests.test_report_format.test_pass_summary_singular_test", + "eval.tests.test_report_format.test_pass_summary_zero_selected_is_plural", + "eval.tests.test_report_format.test_pass_zen_with_abort_omits_decomposition_then_stops", + "eval.tests.test_report_format.test_pass_zero_selected_after_wildcard_negation", + "eval.tests.test_report_format.test_report_line_shape_is_file_line_kind_test_expr", + "eval.tests.test_report_format.test_specified_exception_capture_of_type", + "eval.tests.test_report_format.test_time_full_run_reports_all_seven_durations", + "eval.tests.test_report_format.test_time_with_abort_stops_timing_at_first_failure", + "eval.tests.test_report_format.test_time_with_pass_reports_pass_lines_then_duration", + "eval.tests.test_report_format.test_time_with_selector_reports_single_duration", + "eval.tests.test_report_format.test_unexpected_and_expected_kinds_coexist_in_pass_run", + "eval.tests.test_report_format.test_unexpected_exception_report_carries_what_message", + "eval.tests.test_selectors.test_dash_selector_matches_nothing", + "eval.tests.test_selectors.test_empty_selector_argument_is_an_all_selector", + "eval.tests.test_selectors.test_list_tests_with_multiple_markers_returns_empty", + "eval.tests.test_selectors.test_multiple_positive_selectors_union", + "eval.tests.test_selectors.test_negated_selector_and_wildcard", + "eval.tests.test_selectors.test_negated_selector_omits_matching_tests[!captured-expected1]", + "eval.tests.test_selectors.test_negated_selector_omits_matching_tests[!exception-expected0]", + "eval.tests.test_selectors.test_negated_selector_omits_matching_tests[!lexically-expected2]", + "eval.tests.test_selectors.test_negated_selector_with_run_counts_failures", + "eval.tests.test_selectors.test_negated_wildcard_omits_subset", + "eval.tests.test_selectors.test_omission_override_runs_after_later_positive", + "eval.tests.test_selectors.test_option_like_text_after_marker_is_selector", + "eval.tests.test_selectors.test_positive_then_negative_reduces_union", + "eval.tests.test_selectors.test_selecting_only_passing_case_reports_zero_failures", + "eval.tests.test_selectors.test_selector_is_case_insensitive", + "eval.tests.test_selectors.test_single_positive_selector_that_selects_all_failing", + "eval.tests.test_selectors.test_text_selector_selects_matching_tests[captured-expected1]", + "eval.tests.test_selectors.test_text_selector_selects_matching_tests[exception-expected0]", + "eval.tests.test_selectors.test_text_selector_selects_matching_tests[lexically-expected2]", + "eval.tests.test_selectors.test_text_selector_selects_matching_tests[string-expected3]", + "eval.tests.test_selectors.test_wildcards_select_all_tests[*]", + "eval.tests.test_selectors.test_wildcards_select_all_tests[@]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_order_persistence.test_order_declared_after_random_keeps_random", + "reasons": [ + { + "id": "test_random_without_seed", + "message": "test uses randomness without an explicit seed", + "path": "eval/tests/test_cli_order_persistence.py", + "repair_hint": "Seed randomness or remove random behavior from the test oracle.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_assertion_messages.test_expect_failure_reports_decomposition", + "eval.tests.test_assertion_messages.test_expect_not_pass_reports_negated_operands", + "eval.tests.test_assertion_messages.test_expect_throws_as_missing_reports_type", + "eval.tests.test_assertion_messages.test_expect_throws_as_pass_reports_type", + "eval.tests.test_assertion_messages.test_expect_throws_missing_runtime_exception", + "eval.tests.test_assertion_messages.test_expect_throws_pass_reports_got_exception", + "eval.tests.test_assertion_messages.test_expect_unexpected_exception_message", + "eval.tests.test_assertion_messages.test_failure_count_equals_reported_failure_records", + "eval.tests.test_assertion_messages.test_no_failure_records_for_clean_run", + "eval.tests.test_assertion_messages.test_pass_succeed_exact_three_reports", + "eval.tests.test_cli_abort.test_abort_alias_long", + "eval.tests.test_cli_abort.test_abort_passing_selection_still_zero", + "eval.tests.test_cli_abort.test_abort_stops_at_first_failure", + "eval.tests.test_cli_abort.test_abort_stops_at_first_failure_in_random_order", + "eval.tests.test_cli_abort.test_abort_with_repeat_fails_once", + "eval.tests.test_cli_abort.test_abort_with_two_failing_selection", + "eval.tests.test_cli_argument_parsing.test_after_double_dash_a_dash_word_is_a_spec", + "eval.tests.test_cli_argument_parsing.test_double_dash_ends_options", + "eval.tests.test_cli_argument_parsing.test_error_goes_to_stdout_not_stderr", + "eval.tests.test_cli_argument_parsing.test_error_suffix_try_help_present", + "eval.tests.test_cli_argument_parsing.test_exit_code_for_error_is_one_with_exact_message", + "eval.tests.test_cli_argument_parsing.test_option_like_word_after_spec_is_a_spec", + "eval.tests.test_cli_argument_parsing.test_option_value_may_contain_equals", + "eval.tests.test_cli_argument_parsing.test_plain_order_without_equals_is_not_an_option", + "eval.tests.test_cli_argument_parsing.test_single_dash_plain_rejected", + "eval.tests.test_cli_argument_parsing.test_unknown_long_option_errors", + "eval.tests.test_cli_argument_parsing.test_unknown_option_combined_with_known_still_fails", + "eval.tests.test_cli_argument_parsing.test_unknown_order_value_matches_help_hint", + "eval.tests.test_cli_argument_parsing.test_unknown_short_option_errors", + "eval.tests.test_cli_count_list_tags.test_count_alias_long", + "eval.tests.test_cli_count_list_tags.test_count_does_not_run_bodies", + "eval.tests.test_cli_count_list_tags.test_count_prints_plural", + "eval.tests.test_cli_count_list_tags.test_count_singular_when_one", + "eval.tests.test_cli_count_list_tags.test_count_zero_when_none", + "eval.tests.test_cli_count_list_tags.test_list_does_not_report_failures", + "eval.tests.test_cli_count_list_tags.test_list_order_declared_long_form", + "eval.tests.test_cli_count_list_tags.test_list_prints_each_case_name", + "eval.tests.test_cli_count_list_tags.test_list_respects_filter", + "eval.tests.test_cli_count_list_tags.test_list_tags_long_alias", + "eval.tests.test_cli_count_list_tags.test_list_tags_prints_nothing_when_no_tags", + "eval.tests.test_cli_count_list_tags.test_list_tests_long_alias", + "eval.tests.test_cli_edge_cases.test_order_manual_is_unrecognised_value", + "eval.tests.test_cli_edge_cases.test_order_sideways_is_unrecognised_value", + "eval.tests.test_cli_edge_cases.test_positive_list_refined_by_omit", + "eval.tests.test_cli_edge_cases.test_two_omits_list_exact_remaining_names", + "eval.tests.test_cli_edge_cases.test_two_omits_remove_two_groups", + "eval.tests.test_cli_edge_cases.test_union_missing_and_succeed_counts_three", + "eval.tests.test_cli_edge_cases.test_union_missing_and_succeed_lists_exact_names", + "eval.tests.test_cli_edge_cases.test_wildcard_star_minus_unexpected_counts_six", + "eval.tests.test_cli_exit_codes.test_clean_selection_zero_exit", + "eval.tests.test_cli_exit_codes.test_exit_code_258_wraps_to_2", + "eval.tests.test_cli_exit_codes.test_exit_code_counts_failures_across_repeat", + "eval.tests.test_cli_exit_codes.test_exit_code_equals_failure_count", + "eval.tests.test_cli_exit_codes.test_exit_code_wraps_mod_256", + "eval.tests.test_cli_exit_codes.test_no_failures_selection_zero_exit", + "eval.tests.test_cli_flags_more.test_at_plus_positive_spec_selects_all", + "eval.tests.test_cli_flags_more.test_count_with_random_order_unaffected", + "eval.tests.test_cli_flags_more.test_duplicate_positive_spec_counts_once", + "eval.tests.test_cli_flags_more.test_exclude_at_wildcard_selects_all", + "eval.tests.test_cli_flags_more.test_help_with_indefinite_repeat_terminates", + "eval.tests.test_cli_flags_more.test_list_beats_pass_reporting", + "eval.tests.test_cli_flags_more.test_pass_full_suite_reports_all_assertions", + "eval.tests.test_cli_flags_more.test_positive_spec_then_at_selects_all", + "eval.tests.test_cli_flags_more.test_repeat_minus_one_with_at_count_terminates", + "eval.tests.test_cli_flags_more.test_tags_empty_on_nonmatching_selection", + "eval.tests.test_cli_flags_more.test_time_on_empty_selection_lists_no_cases", + "eval.tests.test_cli_flags_more.test_uppercase_exclude_is_case_insensitive", + "eval.tests.test_cli_help_version.test_help_does_not_execute_cases", + "eval.tests.test_cli_help_version.test_help_long_exits_zero_and_lists_options", + "eval.tests.test_cli_help_version.test_help_output_is_deterministic", + "eval.tests.test_cli_help_version.test_help_precedes_later_bad_option", + "eval.tests.test_cli_help_version.test_help_short_same_content", + "eval.tests.test_cli_help_version.test_verbose_does_not_report_pass_without_pass", + "eval.tests.test_cli_help_version.test_verbose_noop_when_no_sections", + "eval.tests.test_cli_help_version.test_version_reports_lest_version_and_url", + "eval.tests.test_cli_help_version.test_version_short_not_supported", + "eval.tests.test_cli_order_persistence.test_lexical_and_random_combined_differs_from_pure_random", + "eval.tests.test_cli_order_persistence.test_lexical_and_random_together_sort_then_shuffle", + "eval.tests.test_cli_order_persistence.test_order_declared_after_lexical_keeps_lexical", + "eval.tests.test_cli_order_persistence.test_order_declared_after_random_keeps_random", + "eval.tests.test_cli_order_persistence.test_random_seed_without_random_order_is_ignored", + "eval.tests.test_cli_order_persistence.test_time_reports_cases_in_random_order", + "eval.tests.test_cli_order_random.test_bad_order_value_rejected", + "eval.tests.test_cli_order_random.test_declared_keeps_source_order", + "eval.tests.test_cli_order_random.test_lexical_differs_from_declared", + "eval.tests.test_cli_order_random.test_order_declared_explicit_matches_default", + "eval.tests.test_cli_order_random.test_order_lexical_sorts_names", + "eval.tests.test_cli_order_random.test_order_random_with_fixed_seed_is_deterministic", + "eval.tests.test_cli_order_random.test_order_random_with_running_keeps_failure_count", + "eval.tests.test_cli_order_random.test_order_requires_equals_value", + "eval.tests.test_cli_order_random.test_random_different_seed_different_order", + "eval.tests.test_cli_order_random.test_random_lists_all_seven", + "eval.tests.test_cli_order_random.test_zero_seed_accepted", + "eval.tests.test_cli_pass_zen.test_expect_not_pass_reports_negation", + "eval.tests.test_cli_pass_zen.test_pass_includes_decomposition", + "eval.tests.test_cli_pass_zen.test_pass_reports_passing_assertions", + "eval.tests.test_cli_pass_zen.test_pass_still_reports_failures", + "eval.tests.test_cli_pass_zen.test_pass_zen_implies_pass", + "eval.tests.test_cli_pass_zen.test_pass_zen_omits_decomposition", + "eval.tests.test_cli_pass_zen.test_throws_as_pass_reports_type", + "eval.tests.test_cli_pass_zen.test_throws_pass_reports_got_exception", + "eval.tests.test_cli_pass_zen.test_zen_applies_to_failure_expansions_too", + "eval.tests.test_cli_precedence.test_count_wins_over_list", + "eval.tests.test_cli_precedence.test_count_wins_over_pass_reporting", + "eval.tests.test_cli_precedence.test_count_wins_over_time", + "eval.tests.test_cli_precedence.test_help_overrides_confirm_of_failing_case", + "eval.tests.test_cli_precedence.test_help_wins_in_either_argument_order", + "eval.tests.test_cli_precedence.test_help_wins_over_version", + "eval.tests.test_cli_precedence.test_list_wins_over_list_tags", + "eval.tests.test_cli_precedence.test_time_loses_to_count_with_pass", + "eval.tests.test_cli_precedence.test_version_does_not_run_cases", + "eval.tests.test_cli_repeat_seed.test_random_seed_bad_value_rejected", + "eval.tests.test_cli_repeat_seed.test_random_seed_empty_value_accepted_as_zero", + "eval.tests.test_cli_repeat_seed.test_random_seed_numeric_accepted", + "eval.tests.test_cli_repeat_seed.test_random_seed_time_accepted", + "eval.tests.test_cli_repeat_seed.test_random_seed_value_without_equals_becomes_spec", + "eval.tests.test_cli_repeat_seed.test_repeat_count_uses_repetitions_in_total", + "eval.tests.test_cli_repeat_seed.test_repeat_empty_value_parses_as_zero", + "eval.tests.test_cli_repeat_seed.test_repeat_minus_one_drives_only_confirm_action", + "eval.tests.test_cli_repeat_seed.test_repeat_minus_one_ignored_by_count_action", + "eval.tests.test_cli_repeat_seed.test_repeat_negative_other_than_minus_one_rejected", + "eval.tests.test_cli_repeat_seed.test_repeat_nonnumber_parses_as_zero", + "eval.tests.test_cli_repeat_seed.test_repeat_runs_case_multiple_times", + "eval.tests.test_cli_repeat_seed.test_repeat_with_pass_mode_reports_each_repetition", + "eval.tests.test_cli_repeat_seed.test_repeat_with_random_order_is_deterministic", + "eval.tests.test_cli_repeat_seed.test_repeat_zero_selects_but_runs_nothing", + "eval.tests.test_cli_selection.test_count_excludes_additive", + "eval.tests.test_cli_selection.test_empty_spec_selects_all", + "eval.tests.test_cli_selection.test_exclude_leaves_rest_runnable", + "eval.tests.test_cli_selection.test_exclude_only_spec_selects_complement", + "eval.tests.test_cli_selection.test_exclude_prefix_omits", + "eval.tests.test_cli_selection.test_exclude_then_include_keeps_exclude_result", + "eval.tests.test_cli_selection.test_inclusion_and_exclusion_of_same_substring", + "eval.tests.test_cli_selection.test_list_with_filter", + "eval.tests.test_cli_selection.test_multiple_specs_are_unioned", + "eval.tests.test_cli_selection.test_nonmatching_default_run_is_empty", + "eval.tests.test_cli_selection.test_nonmatching_spec_selects_none", + "eval.tests.test_cli_selection.test_spec_negative_refinement_removes_overlap", + "eval.tests.test_cli_selection.test_spec_with_negative_refines_selection", + "eval.tests.test_cli_selection.test_substring_matches_case_insensitively", + "eval.tests.test_cli_selection.test_substring_select_single_count", + "eval.tests.test_cli_selection.test_substring_selects_multiple_overlapping", + "eval.tests.test_cli_selection.test_two_excludes_select_complement", + "eval.tests.test_cli_selection.test_wildcard_at_selects_all", + "eval.tests.test_cli_selection.test_wildcard_at_with_exclude", + "eval.tests.test_cli_selection.test_wildcard_star_selects_all", + "eval.tests.test_cli_selection.test_wildcard_star_with_exclude", + "eval.tests.test_cli_time.test_time_does_not_report_failures", + "eval.tests.test_cli_time.test_time_exit_code_returns_failure_count", + "eval.tests.test_cli_time.test_time_follows_filter", + "eval.tests.test_cli_time.test_time_long_alias", + "eval.tests.test_cli_time.test_time_prints_per_case_ms_and_elapsed", + "eval.tests.test_cli_time.test_time_reports_each_selected_case", + "eval.tests.test_harness_run.test_clean_selection_exits_zero_and_prints_nothing", + "eval.tests.test_harness_run.test_default_order_is_declared_order", + "eval.tests.test_harness_run.test_failure_body_names_the_case", + "eval.tests.test_harness_run.test_failure_exit_code_tracks_failure_count", + "eval.tests.test_harness_run.test_no_args_runs_all_and_reports_four_failures", + "eval.tests.test_harness_run.test_reports_contain_source_location_anchor", + "eval.tests.test_harness_run.test_select_missing_cases_only", + "eval.tests.test_harness_run.test_single_failure_summary_uses_singular", + "eval.tests.test_harness_run.test_specific_missing_uses_singular", + "eval.tests.test_harness_run.test_unexpected_exception_reports_message" + ] + } + }, + "commit": "60b19931a23b562905b32762aefc6fa9155aab5a", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.696356388733332, + "eval_clean_hashes": [ + "1a348dece4814a269d9b2a056106d986c180a975ab17dd945fe81e8530bad5f0" + ], + "input_record": { + "commit": "60b19931a23b562905b32762aefc6fa9155aab5a", + "difficulty": "easy", + "difficulty_code_lines": 4970, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 4970, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.696356388733332, + "difficulty_test_code_lines": 5266, + "full_name": "martinmoene/lest", + "input_joern_zip": "cpp_joern/martinmoene__lest.zip", + "joern_status": true, + "joern_time": 8.462968345033005, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 854, + "similarity": 0.4634493887424469 + }, + { + "pb_fullname": "ninja-build/ninja", + "rank": 52, + "similarity": 0.5090109705924988 + } + ], + "repo_path": "cpp/martinmoene__lest", + "source": "commit:60b19931a23b562905b32762aefc6fa9155aab5a", + "status": "done", + "url": "https://github.com/martinmoene/lest" + }, + "instance_id": "martinmoene__lest.60b1993", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "martinmoene/lest" +} diff --git a/martinmoene--lest.60b1993/tests/test.sh b/martinmoene--lest.60b1993/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/martinmoene--lest.60b1993/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/martinmoene--lest.60b1993/tests/workspace.tar.gz b/martinmoene--lest.60b1993/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b120d83928176784192af4fff4a6bd7579f69528 --- /dev/null +++ b/martinmoene--lest.60b1993/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a65efa47bc6773aaa9172adb021ba402b005d94dfb550efa03f1ae9f1e5c5c3 +size 11683 diff --git a/martinobdl--itch.2c3ab03/environment/Dockerfile b/martinobdl--itch.2c3ab03/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/martinobdl--itch.2c3ab03/environment/docker-compose.yaml b/martinobdl--itch.2c3ab03/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinobdl--itch.2c3ab03/environment/download.sh b/martinobdl--itch.2c3ab03/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5cd59cf3c573146f5537dc1d4cd5e3c0e03d7573 --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/download.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# ProgramGym download stage for martinobdl/ITCH. +# +# This is a pure Makefile-based C++ project. The selected target +# (bin/BookConstructor) is built entirely from the repository sources with the +# system C++ toolchain; there are no third-party libraries, archived sources, +# or package-manager-managed dependencies to fetch. +# +# The base image already provides the required toolchain (g++/gcc, make), so +# this script only verifies that those tools are available and editable. It +# deliberately performs no compilation, linking, testing, or packaging. It is +# designed to be sourced (`source /source_ro/download.sh`) from the repository +# root, is idempotent, and never calls `exit` in normal control flow. + +# --- validate required toolchain is present --------------------------------- +for tool in g++ make; do + if ! command -v "${tool}"; then + echo "Required tool '${tool}' is not available in this environment." >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi + fi +done + +# Export the CXX make variable the Makefile would otherwise infer. The Makefile +# does not set CXX itself, so g++ (the base image compiler) is used by default; +# pinning it here keeps the build deterministic across environments that might +# otherwise resolve a different default C++ compiler. +export CXX="${CXX:-g++}" + +# Export nothing else. build.sh runs the repository's real build system and +# needs no further environment from this stage. diff --git a/martinobdl--itch.2c3ab03/environment/executable b/martinobdl--itch.2c3ab03/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..caebc6f1bacf1638e7f00c9cb896046dca214bb9 --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40bdd3260e07c748be6fa23a9ffc844ec6e750e4139c4671f2a58d4c1b9054e1 +size 2824664 diff --git a/martinobdl--itch.2c3ab03/environment/harbor_configure_apt_mirror.sh b/martinobdl--itch.2c3ab03/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinobdl--itch.2c3ab03/environment/harbor_prepare_download_env.sh b/martinobdl--itch.2c3ab03/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinobdl--itch.2c3ab03/environment/workspace.tar.gz b/martinobdl--itch.2c3ab03/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4d2833270bb246d1dc5e75b303047b254f1b9cc3 --- /dev/null +++ b/martinobdl--itch.2c3ab03/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4af667c8306b289fe673904f5193fc5574be51ba00f39dd5c614ce23435e0b42 +size 8931 diff --git a/martinobdl--itch.2c3ab03/instruction.md b/martinobdl--itch.2c3ab03/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/martinobdl--itch.2c3ab03/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/martinobdl--itch.2c3ab03/solution/solve.sh b/martinobdl--itch.2c3ab03/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/martinobdl--itch.2c3ab03/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/martinobdl--itch.2c3ab03/task.toml b/martinobdl--itch.2c3ab03/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a68520d51c44e8e8cadc55e3388860c1d26cd44d --- /dev/null +++ b/martinobdl--itch.2c3ab03/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/martinobdl--itch.2c3ab03" +description = "Synthetic ProgramGym cleanroom reconstruction task for martinobdl/ITCH" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "martinobdl__ITCH.2c3ab03" +repository = "martinobdl/ITCH" +commit = "2c3ab0305ab51788ce3283d176e13d6b2910e62b" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.2523675144598987 +test_branches = 4 +test_count = 449 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/martinobdl--itch.2c3ab03/tests/Dockerfile b/martinobdl--itch.2c3ab03/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_01.tar.gz b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..275b8c3024e05333bfa1cbd3c1f91257c8093b12 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:338c229ac8e833bd356035f56243f6554e625d26fd3495c109242afdeb01c040 +size 21152 diff --git a/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_02.tar.gz b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..eb675863f6cb13de1457c1ab87f5260b5de74e91 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f43208c78b40e50c9c0e0f3c6f22736633b341aca3c4e57e6aceee6664f1dd3 +size 23660 diff --git a/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_03.tar.gz b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ec9ede8efeb6d3a1b552612ecd80dc1d19c7ad8 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38f291adf47c3a305bde0143744fc9a4014198945ee1752161eabc287a6207ec +size 20078 diff --git a/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_04.tar.gz b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..97f00ef9f72014cd042230ef7360beb32af271e9 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:190cf78bd3bb6b88b06be837a15a0a68b2d41fec1d9ab181a27a0759ec4a137f +size 25284 diff --git a/martinobdl--itch.2c3ab03/tests/docker-compose.yaml b/martinobdl--itch.2c3ab03/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinobdl--itch.2c3ab03/tests/download.sh b/martinobdl--itch.2c3ab03/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..5cd59cf3c573146f5537dc1d4cd5e3c0e03d7573 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/download.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# ProgramGym download stage for martinobdl/ITCH. +# +# This is a pure Makefile-based C++ project. The selected target +# (bin/BookConstructor) is built entirely from the repository sources with the +# system C++ toolchain; there are no third-party libraries, archived sources, +# or package-manager-managed dependencies to fetch. +# +# The base image already provides the required toolchain (g++/gcc, make), so +# this script only verifies that those tools are available and editable. It +# deliberately performs no compilation, linking, testing, or packaging. It is +# designed to be sourced (`source /source_ro/download.sh`) from the repository +# root, is idempotent, and never calls `exit` in normal control flow. + +# --- validate required toolchain is present --------------------------------- +for tool in g++ make; do + if ! command -v "${tool}"; then + echo "Required tool '${tool}' is not available in this environment." >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi + fi +done + +# Export the CXX make variable the Makefile would otherwise infer. The Makefile +# does not set CXX itself, so g++ (the base image compiler) is used by default; +# pinning it here keeps the build deterministic across environments that might +# otherwise resolve a different default C++ compiler. +export CXX="${CXX:-g++}" + +# Export nothing else. build.sh runs the repository's real build system and +# needs no further environment from this stage. diff --git a/martinobdl--itch.2c3ab03/tests/executable b/martinobdl--itch.2c3ab03/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..caebc6f1bacf1638e7f00c9cb896046dca214bb9 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40bdd3260e07c748be6fa23a9ffc844ec6e750e4139c4671f2a58d4c1b9054e1 +size 2824664 diff --git a/martinobdl--itch.2c3ab03/tests/harbor_configure_apt_mirror.sh b/martinobdl--itch.2c3ab03/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinobdl--itch.2c3ab03/tests/harbor_prepare_download_env.sh b/martinobdl--itch.2c3ab03/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinobdl--itch.2c3ab03/tests/programgym_evaluator.py b/martinobdl--itch.2c3ab03/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/martinobdl--itch.2c3ab03/tests/programgym_task.json b/martinobdl--itch.2c3ab03/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..152fe1b10e9f751bcfcbdc9747bcbdd07a67df56 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/programgym_task.json @@ -0,0 +1,633 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_arguments.test_fewer_than_four_args_prints_usage_and_fails[0]", + "eval.tests.test_arguments.test_fewer_than_four_args_prints_usage_and_fails[1]", + "eval.tests.test_arguments.test_fewer_than_four_args_prints_usage_and_fails[2]", + "eval.tests.test_arguments.test_fewer_than_four_args_prints_usage_and_fails[3]", + "eval.tests.test_arguments.test_four_positional_args_abort_on_bad_levels", + "eval.tests.test_arguments.test_input_basename_determines_output_names", + "eval.tests.test_arguments.test_levels_argument_controls_book_header_depth", + "eval.tests.test_arguments.test_levels_one_emits_single_depth_columns", + "eval.tests.test_arguments.test_levels_overflowing_size_t_aborts_out_of_range", + "eval.tests.test_arguments.test_levels_zero_writes_book_header_of_depth_zero", + "eval.tests.test_arguments.test_lowercase_ticker_variant_is_filtered_out", + "eval.tests.test_arguments.test_missing_input_file_reports_error_and_writes_headers", + "eval.tests.test_arguments.test_path_without_separator_yields_no_basename_outputs", + "eval.tests.test_arguments.test_single_char_stock_pads_ticker_and_names_outputs", + "eval.tests.test_arguments.test_stock_argument_appears_in_output_names", + "eval.tests.test_arguments.test_stock_longer_than_eight_chars_aborts_length_error", + "eval.tests.test_book_sideeffects.test_add_to_ask_wins_consistency_guard_with_bid_above", + "eval.tests.test_book_sideeffects.test_delete_removes_level_volume", + "eval.tests.test_book_sideeffects.test_execute_reduces_level_volume", + "eval.tests.test_book_sideeffects.test_multi_level_depth_sorted", + "eval.tests.test_book_sideeffects.test_partial_cancel_lowers_level_volume", + "eval.tests.test_book_sideeffects.test_reduced_levels_clips_visibility", + "eval.tests.test_book_sideeffects.test_same_price_orders_aggregate_volume", + "eval.tests.test_book_sideeffects.test_sell_add_writes_ask_level", + "eval.tests.test_book_sideeffects.test_single_add_appears_in_book", + "eval.tests.test_closure_state.test_fully_closed_order_leaves_empty_pool_no_remaining_trace", + "eval.tests.test_closure_state.test_oversized_execute_drives_negative_book_and_traces_order", + "eval.tests.test_closure_state.test_partial_cancel_leaves_remaining_order_on_closure", + "eval.tests.test_closure_state.test_two_resting_orders_trace_both_ids_sorted", + "eval.tests.test_closure_state.test_unfilled_add_leaves_order_in_pool_on_closure", + "eval.tests.test_endian.test_big_endian_16bit_swaps_are_correct", + "eval.tests.test_endian.test_big_endian_32bit_price_roundtrip", + "eval.tests.test_endian.test_big_endian_64bit_roundtrip", + "eval.tests.test_endian.test_big_endian_mixed_byte_block_decodes_constituents", + "eval.tests.test_endian.test_exec_size_big_endian_32", + "eval.tests.test_endian.test_parse_ts_48bit_bounds", + "eval.tests.test_msg_add.test_add_buy_order_decodes_fields", + "eval.tests.test_msg_add.test_add_embedded_matching_ticker_keeps_message", + "eval.tests.test_msg_add.test_add_embedded_ticker_mismatch_discards_message", + "eval.tests.test_msg_add.test_add_max_48bit_timestamp_boundary", + "eval.tests.test_msg_add.test_add_max_uint32_price_boundary", + "eval.tests.test_msg_add.test_add_max_uint32_size_boundary", + "eval.tests.test_msg_add.test_add_max_uint64_order_id_boundary", + "eval.tests.test_msg_add.test_add_min_zero_timestamp_and_zero_size", + "eval.tests.test_msg_add.test_add_price_below_one_dollar_scales_by_ten_thousand", + "eval.tests.test_msg_add.test_add_sell_order_uses_side_one", + "eval.tests.test_msg_add.test_f_message_maps_to_type_a_and_keeps_mpid", + "eval.tests.test_msg_add.test_two_add_messages_are_processed_in_stream_order", + "eval.tests.test_msg_othertypes.test_empty_stream_terminates_cleanly", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[B]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[H]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[I]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[J]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[K]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[L]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[N]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[Q]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[R]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[S]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[V]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[W]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[Y]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_interleaved_with_add[h]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[B]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[H]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[I]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[J]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[K]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[L]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[N]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[Q]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[R]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[S]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[V]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[W]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[Y]", + "eval.tests.test_msg_othertypes.test_non_decoded_type_is_consumed_not_written[h]", + "eval.tests.test_msg_othertypes.test_truncated_body_reuses_stale_buffer_for_add", + "eval.tests.test_msg_othertypes.test_truncated_body_yields_eof_without_abort", + "eval.tests.test_msg_othertypes.test_unknown_key_prints_abort_and_stops", + "eval.tests.test_msg_othertypes.test_unknown_lowercase_key_aborts", + "eval.tests.test_msg_transitions.test_execute_diff_price_c_tracks_original_price", + "eval.tests.test_msg_transitions.test_execute_reduces_remaining_size", + "eval.tests.test_msg_transitions.test_execute_unknown_order_is_ignored", + "eval.tests.test_msg_transitions.test_full_delete_d_resolves_full_cancel", + "eval.tests.test_msg_transitions.test_full_lifecycle_add_execute_cancel_close", + "eval.tests.test_msg_transitions.test_hidden_execute_p_keeps_exec_size_only", + "eval.tests.test_msg_transitions.test_oversized_cancel_yields_negative_book_and_stderr", + "eval.tests.test_msg_transitions.test_partial_cancel_x_reduces_remaining", + "eval.tests.test_msg_transitions.test_replace_moves_order_to_new_price_level", + "eval.tests.test_msg_transitions.test_replace_u_keeps_old_and_new", + "eval.tests.test_pipeline_lifecycle.test_getfilename_and_stock_accessors_reflected_in_filenames", + "eval.tests.test_pipeline_lifecycle.test_multiple_messages_increment_processed_count", + "eval.tests.test_pipeline_lifecycle.test_reader_prints_close_and_processed_count", + "eval.tests.test_pipeline_lifecycle.test_reader_prints_open_line_for_existing_file", + "eval.tests.test_pipeline_lifecycle.test_reader_reports_unopenable_file_and_skips_processing", + "eval.tests.test_stateful_batch.test_a_partial_execute_then_full_delete_enumeration", + "eval.tests.test_stateful_batch.test_full_close_by_multiple_partial_cancels", + "eval.tests.test_stateful_batch.test_interleaved_two_ticker_stream_filters_to_one", + "eval.tests.test_stateful_batch.test_mixed_lifecycle_causal_batch", + "eval.tests.test_stateful_batch.test_p_hidden_execution_on_resting_order_leaves_book_unchanged", + "eval.tests.test_stateful_batch.test_replace_same_order_id_reprices_in_place", + "eval.tests.test_stateful_batch.test_two_orders_same_price_one_full_executed_other_rests", + "eval.tests.test_transitions_enrichment.test_execute_diff_price_on_ask_side", + "eval.tests.test_transitions_enrichment.test_full_delete_on_ask_uses_pool_size", + "eval.tests.test_transitions_enrichment.test_iterated_replace_chain_carries_previous_state", + "eval.tests.test_transitions_enrichment.test_mpid_enriched_across_lifecycle_ec_d_rows", + "eval.tests.test_transitions_enrichment.test_non_sell_direction_byte_decodes_to_buy_side", + "eval.tests.test_transitions_enrichment.test_partial_cancel_on_ask_reduces_ask_level", + "eval.tests.test_transitions_enrichment.test_party_fill_partial_executes_sum_to_full", + "eval.tests.test_transitions_enrichment.test_replace_ask_order_reprices_ask_level", + "eval.tests.test_transitions_enrichment.test_replace_at_same_price_changes_volume_only", + "eval.tests.test_transitions_enrichment.test_replace_new_id_collides_with_resting_order", + "eval.tests.test_transitions_enrichment.test_two_sided_spread_book_sorted" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_message_action_edges.test_p_execution_keeps_pooled_order_and_book_unchanged", + "reasons": [ + { + "detail": "AssertionError: assert ['1,A,1,0,50,...0,,10,,7,,,,'] == ['1,A,1,0,50,...,,10,,7,,,,,'] At index 1 diff: '2,P,1,0,,10,,7,,,,' != '2,P,1,0,,10,,7,,,,,' Full diff: [ '1,A,1,0,50,10,,,,,,', - '2,P,1,0,,1", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + } + ], + "tests": [ + "eval.tests.test_book_consistency_and_negative_size.test_bid_price_greater_than_ask_reports_consistency_error", + "eval.tests.test_book_consistency_and_negative_size.test_consistency_error_emitted_once_per_inversion[-0]", + "eval.tests.test_book_consistency_and_negative_size.test_consistency_error_emitted_once_per_inversion[-1_0]", + "eval.tests.test_book_consistency_and_negative_size.test_consistency_error_emitted_once_per_inversion[-1_1]", + "eval.tests.test_book_consistency_and_negative_size.test_consistency_error_reported_on_second_offset", + "eval.tests.test_book_consistency_and_negative_size.test_consistent_bid_below_ask_emits_no_error", + "eval.tests.test_book_consistency_and_negative_size.test_equal_bid_ask_price_crosses_without_error", + "eval.tests.test_book_consistency_and_negative_size.test_one_sided_book_passes_consistency_check", + "eval.tests.test_book_consistency_and_negative_size.test_over_cancel_reports_negative_size_diagnostics", + "eval.tests.test_book_consistency_and_negative_size.test_over_execute_reports_negative_size_diagnostics", + "eval.tests.test_book_depth.test_ask_side_ordered_price_ascending", + "eval.tests.test_book_depth.test_bid_side_ordered_price_descending", + "eval.tests.test_book_depth.test_delete_middle_price_renumbers_levels", + "eval.tests.test_book_depth.test_full_delete_then_requote_reuses_level_one", + "eval.tests.test_book_depth.test_intermediate_price_slot_inserted_between_levels", + "eval.tests.test_book_depth.test_levels_beyond_actual_depth_fill_empty_cells", + "eval.tests.test_book_depth.test_levels_one_book_shape", + "eval.tests.test_book_depth.test_more_price_points_than_levels_truncates_deepest", + "eval.tests.test_book_depth.test_same_price_bid_volumes_aggregate", + "eval.tests.test_book_output.test_add_bid_writes_bid_level_one", + "eval.tests.test_book_output.test_bid_and_ask_levels_one", + "eval.tests.test_book_output.test_book_output_created_and_named", + "eval.tests.test_book_output.test_delete_removes_bid_from_book", + "eval.tests.test_book_output.test_depth_controls_header_columns[2]", + "eval.tests.test_book_output.test_depth_controls_header_columns[3]", + "eval.tests.test_book_output.test_multi_level_book_populates_levels", + "eval.tests.test_book_output.test_same_price_adds_aggregate_volume", + "eval.tests.test_cli_args.test_empty_levels_aborts_with_stoul", + "eval.tests.test_cli_args.test_no_arguments_prints_usage_and_exits_nonzero", + "eval.tests.test_cli_args.test_non_numeric_levels_aborts_with_stoul", + "eval.tests.test_cli_args.test_one_argument_prints_usage", + "eval.tests.test_cli_args.test_three_arguments_still_prints_usage", + "eval.tests.test_cli_args.test_usage_goes_to_stderr_not_stdout", + "eval.tests.test_golden_sequence.test_lifecycle_matches_golden", + "eval.tests.test_golden_sequence.test_lifecycle_rows_are_canonical_letters", + "eval.tests.test_input_file.test_message_csv_header_written_for_valid_run", + "eval.tests.test_input_file.test_missing_input_creates_message_header_only", + "eval.tests.test_input_file.test_missing_input_file_prints_error_and_writes_headers", + "eval.tests.test_input_file.test_output_dir_missing_book_writer_fails", + "eval.tests.test_input_file.test_output_dir_missing_message_writer_fails", + "eval.tests.test_input_file.test_processing_continues_despite_writer_failure", + "eval.tests.test_input_file.test_unreadable_input_still_provisions_book_header", + "eval.tests.test_message_action_edges.test_order_id_zero_is_a_valid_member", + "eval.tests.test_message_action_edges.test_p_execution_keeps_pooled_order_and_book_unchanged", + "eval.tests.test_message_action_edges.test_unmatched_r_replace_writes_no_rows", + "eval.tests.test_message_action_edges.test_unmatched_x_cancel_writes_no_rows", + "eval.tests.test_message_add.test_add_buy_sets_side_zero", + "eval.tests.test_message_add.test_add_order_row_exact[1-2-B-0-1000000-50000-5]", + "eval.tests.test_message_add.test_add_order_row_exact[1000000-45749-S-1-93-117900-11.79]", + "eval.tests.test_message_add.test_add_order_row_exact[20260822-7-S-1-4096-250000-25]", + "eval.tests.test_message_add.test_add_order_row_exact[28800006862979-999-S-1-500-100000-10]", + "eval.tests.test_message_add.test_add_order_row_exact[42-123456789-B-0-0-310500-31.05]", + "eval.tests.test_message_add.test_add_order_row_exact[99-1-B-0-1-10000-1]", + "eval.tests.test_message_add.test_add_sell_sets_side_one", + "eval.tests.test_message_add.test_add_size_column_is_remaining_size", + "eval.tests.test_message_add.test_add_tail_columns_all_empty", + "eval.tests.test_message_add.test_multiple_adds_append_rows_in_order", + "eval.tests.test_message_add.test_price_is_scaled_by_one_thousandth", + "eval.tests.test_message_csv_fields.test_cancSize_column_emitted_on_partial_cancel", + "eval.tests.test_message_csv_fields.test_empty_row_shape_has_twelve_fields", + "eval.tests.test_message_csv_fields.test_execSize_column_emitted_on_execution", + "eval.tests.test_message_csv_fields.test_mpid_empty_for_plain_add", + "eval.tests.test_message_csv_fields.test_mpid_set_for_F_add", + "eval.tests.test_message_csv_fields.test_oldPrice_column_emitted_on_different_price_execution", + "eval.tests.test_message_csv_fields.test_old_columns_emitted_on_replace", + "eval.tests.test_message_csv_fields.test_remSize_zero_is_still_written", + "eval.tests.test_message_edge_cases.test_empty_feed_with_nonmatching_stock_still_writes_headers", + "eval.tests.test_message_edge_cases.test_empty_readable_feed_produces_only_headers", + "eval.tests.test_message_edge_cases.test_hidden_p_execution_does_not_change_book", + "eval.tests.test_message_edge_cases.test_large_order_id_survives_csv_roundtrip", + "eval.tests.test_message_edge_cases.test_long_multi_type_enrichment_chain", + "eval.tests.test_message_edge_cases.test_mid_stream_unmatched_delete_is_skipped", + "eval.tests.test_message_edge_cases.test_price_scaling_default_precision[1-0.0001]", + "eval.tests.test_message_edge_cases.test_price_scaling_default_precision[1000006-100.001]", + "eval.tests.test_message_edge_cases.test_price_scaling_default_precision[1000500-100.05]", + "eval.tests.test_message_edge_cases.test_price_scaling_default_precision[2000005-200]", + "eval.tests.test_message_edge_cases.test_price_scaling_default_precision[99995-9.9995]", + "eval.tests.test_message_edge_cases.test_unmatched_delete_emits_no_message_row", + "eval.tests.test_message_enrichment.test_c_execute_stamps_old_price_and_mpid", + "eval.tests.test_message_enrichment.test_full_execution_writes_zero_remaining_size", + "eval.tests.test_message_enrichment.test_mpid_propagates_to_follow_on_rows[ABCD--10,A,2,1,50,20,,,,,,ABCD-20,E,2,1,0,20,,50,,,,ABCD]", + "eval.tests.test_message_enrichment.test_mpid_propagates_to_follow_on_rows[MZ12--1,A,1,0,100,10,,,,,,MZ12-2,D,1,0,0,10,100,,,,,MZ12]", + "eval.tests.test_message_enrichment.test_mpid_stays_empty_for_plain_add_then_delete", + "eval.tests.test_message_enrichment.test_partial_execution_then_cancel_same_order", + "eval.tests.test_message_enrichment.test_replace_chain_preserves_old_columns", + "eval.tests.test_reader_diagnostics.test_drained_pool_emits_no_closure_report", + "eval.tests.test_reader_diagnostics.test_partially_canceled_order_then_drained_reports_none", + "eval.tests.test_reader_diagnostics.test_processed_count_includes_ignored_system_messages", + "eval.tests.test_reader_diagnostics.test_processed_count_is_exact_for_feed_size[-1]", + "eval.tests.test_reader_diagnostics.test_processed_count_is_exact_for_feed_size[\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01B\\x00\\x00\\x00\\nAAPL \\x00\\x01\\x86\\xa0-2]", + "eval.tests.test_reader_diagnostics.test_processed_count_is_exact_for_feed_size[\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01B\\x00\\x00\\x00\\nAAPL \\x00\\x01\\x86\\xa0\\x00\\x00D\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01-3]", + "eval.tests.test_reader_diagnostics.test_single_remaining_order_reported_at_closure", + "eval.tests.test_stock_filter.test_matching_stock_add_is_kept", + "eval.tests.test_stock_filter.test_mixed_stream_keeps_only_matching_ticker", + "eval.tests.test_stock_filter.test_other_stock_add_is_filtered_out", + "eval.tests.test_stock_filter.test_short_stock_name_padded_with_spaces", + "eval.tests.test_type_translation.test_C_execution_at_difference_stays_C", + "eval.tests.test_type_translation.test_D_full_delete_stays_D", + "eval.tests.test_type_translation.test_E_execution_stays_E", + "eval.tests.test_type_translation.test_F_add_translates_to_A", + "eval.tests.test_type_translation.test_P_hidden_execution_stays_P", + "eval.tests.test_type_translation.test_U_replace_translates_to_R", + "eval.tests.test_type_translation.test_X_partial_cancel_translates_to_D", + "eval.tests.test_writer.test_book_file_closed_announced", + "eval.tests.test_writer.test_book_filename_embeds_stock_and_levels", + "eval.tests.test_writer.test_message_file_closed_announced", + "eval.tests.test_writer.test_opened_book_file_announced", + "eval.tests.test_writer.test_opened_message_file_announced", + "eval.tests.test_writer.test_output_file_naming_uses_stock", + "eval.tests.test_writer.test_reader_announces_input_open_and_close", + "eval.tests.test_writer.test_reader_processes_mixer_stream_count", + "eval.tests.test_writer.test_reader_reports_processed_message_count", + "eval.tests.test_writer.test_writer_flushes_content_to_disk", + "eval.tests.test_writer_book_effects.test_c_cross_price_execution_decrements_old_price_level", + "eval.tests.test_writer_book_effects.test_c_execution_keeps_old_price_for_unmatched_book_change", + "eval.tests.test_writer_book_effects.test_levels_zero_emits_timestamp_only_backing", + "eval.tests.test_writer_book_effects.test_over_cancel_writes_negative_book_volume", + "eval.tests.test_writer_book_effects.test_over_execute_writes_negative_book_volume", + "eval.tests.test_writer_book_effects.test_partial_execute_then_cancel_book_transitions", + "eval.tests.test_writer_book_effects.test_r_replace_keeps_opposite_side_untouched", + "eval.tests.test_writer_book_effects.test_r_replace_moves_volume_between_price_levels" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_validation.test_consumed_key_without_set_type_is_dropped", + "eval.tests.test_cli_validation.test_empty_input_stream_produces_headers_only", + "eval.tests.test_cli_validation.test_exactly_five_arguments_proceeds", + "eval.tests.test_cli_validation.test_four_arguments_aborts_not_usage", + "eval.tests.test_cli_validation.test_insufficient_arguments_rejected[1]", + "eval.tests.test_cli_validation.test_insufficient_arguments_rejected[2]", + "eval.tests.test_cli_validation.test_insufficient_arguments_rejected[3]", + "eval.tests.test_cli_validation.test_invalid_levels_argument_aborts", + "eval.tests.test_cli_validation.test_levels_zero_produces_timestamp_only_book_row", + "eval.tests.test_cli_validation.test_missing_input_file_writes_only_headers_and_exits_0", + "eval.tests.test_cli_validation.test_no_arguments_prints_usage_and_exits_1", + "eval.tests.test_cli_validation.test_output_dirs_missing_still_exits_zero", + "eval.tests.test_cli_validation.test_stock_filter_drops_foreign_ticker_add", + "eval.tests.test_cli_validation.test_stock_filter_keeps_matching_ticker_only", + "eval.tests.test_cli_validation.test_unknown_message_type_stops_processing", + "eval.tests.test_golden_outputs.test_canonical_stream_matches_book_golden", + "eval.tests.test_golden_outputs.test_canonical_stream_matches_message_golden", + "eval.tests.test_order_lifecycle.test_cancel_after_over_execution_drives_level_more_negative", + "eval.tests.test_order_lifecycle.test_cancel_unknown_order_id_is_ignored", + "eval.tests.test_order_lifecycle.test_delete_after_over_execution_writes_negative_canc_size", + "eval.tests.test_order_lifecycle.test_double_over_execution_accumulates_negative_size", + "eval.tests.test_order_lifecycle.test_execute_unknown_order_id_is_ignored", + "eval.tests.test_order_lifecycle.test_execution_at_different_price_uses_original_price", + "eval.tests.test_order_lifecycle.test_execution_at_same_price_leaves_old_price_field", + "eval.tests.test_order_lifecycle.test_execution_message_enriched_fields", + "eval.tests.test_order_lifecycle.test_execution_reduces_and_fills_from_pool[100-2000,,,,,,,,-2000,E,1,0,0,10,,100,,,,]", + "eval.tests.test_order_lifecycle.test_execution_reduces_and_fills_from_pool[40-2000,10,60,,,,,,-2000,E,1,0,60,10,,40,,,,]", + "eval.tests.test_order_lifecycle.test_full_add_exec_cancel_lifecycle_leaves_empty_pool", + "eval.tests.test_order_lifecycle.test_full_cancel_defaults_canc_size_to_order_size", + "eval.tests.test_order_lifecycle.test_full_cancel_sell_side_enriches_side_and_price", + "eval.tests.test_order_lifecycle.test_full_execution_at_different_price_empties_original_level", + "eval.tests.test_order_lifecycle.test_full_execution_removes_order_from_pool", + "eval.tests.test_order_lifecycle.test_mixed_over_execution_accumulates_negative_size", + "eval.tests.test_order_lifecycle.test_over_execution_produces_negative_size_diagnostics", + "eval.tests.test_order_lifecycle.test_partial_cancel_reads_canc_size_from_message", + "eval.tests.test_order_lifecycle.test_partial_execution_of_order_id_zero_updates_book", + "eval.tests.test_order_lifecycle.test_replace_cancels_old_and_adds_new", + "eval.tests.test_order_lifecycle.test_replace_changes_price_only_keeps_size", + "eval.tests.test_order_lifecycle.test_replace_changes_size_only_keeps_price", + "eval.tests.test_order_lifecycle.test_replace_of_multi_orders_changes_pool_membership", + "eval.tests.test_order_lifecycle.test_replace_on_shared_ask_level_keeps_sibling", + "eval.tests.test_order_lifecycle.test_replace_on_shared_bid_level_keeps_sibling", + "eval.tests.test_order_lifecycle.test_replace_sell_order_preserves_side_and_updates_ask", + "eval.tests.test_order_lifecycle.test_replace_unknown_old_id_is_ignored", + "eval.tests.test_order_lifecycle.test_same_price_exec_then_exec_chain_reduces_level", + "eval.tests.test_order_lifecycle.test_sell_c_over_execution_prints_side_one_block", + "eval.tests.test_order_lifecycle.test_sell_double_over_execution_accumulates_negative_ask", + "eval.tests.test_order_lifecycle.test_sell_execution_at_different_price_reduces_ask", + "eval.tests.test_order_lifecycle.test_sell_full_execution_at_different_price_empties_ask", + "eval.tests.test_order_lifecycle.test_sell_side_over_execution_prints_side_one_dump", + "eval.tests.test_order_lifecycle.test_two_partial_cancels_then_full_empties_level", + "eval.tests.test_order_pool.test_a_add_vs_f_add_side_encoding", + "eval.tests.test_order_pool.test_anonymous_a_add_has_empty_mpid", + "eval.tests.test_order_pool.test_cancel_carries_mpid_from_matched_order", + "eval.tests.test_order_pool.test_execution_at_different_price_carries_mpid_from_matched_order", + "eval.tests.test_order_pool.test_execution_carries_mpid_from_matched_order", + "eval.tests.test_order_pool.test_execution_side_looked_up_from_pool", + "eval.tests.test_order_pool.test_f_add_carries_mpid_into_message", + "eval.tests.test_order_pool.test_hidden_execution_p_emits_row_but_does_not_touch_book", + "eval.tests.test_order_pool.test_hidden_execution_p_standalone_writes_empty_book_levels", + "eval.tests.test_order_pool.test_hidden_p_does_not_pool_so_later_execution_is_dropped", + "eval.tests.test_order_pool.test_pool_empty_when_all_orders_consumed", + "eval.tests.test_order_pool.test_pool_prints_all_remaining_ids_at_closure", + "eval.tests.test_order_pool.test_pool_retains_order_when_partially_consumed", + "eval.tests.test_order_pool.test_pool_search_missing_returns_empty_without_output", + "eval.tests.test_order_pool.test_replace_carries_mpid_from_matched_order", + "eval.tests.test_order_pool.test_reused_order_id_refounds_both_book_and_pool", + "eval.tests.test_order_pool.test_short_mpid_space_padded_in_message", + "eval.tests.test_order_pool.test_two_executions_erase_order_on_final_full_execution", + "eval.tests.test_order_pool.test_update_pool_partial_execution_keeps_order", + "eval.tests.test_order_pool.test_zero_order_id_is_a_valid_nonempty_order", + "eval.tests.test_orderbook.test_best_level_after_large_price_follows_insertion", + "eval.tests.test_orderbook.test_bid_level_refills_after_full_execution", + "eval.tests.test_orderbook.test_book_cross_bid_above_ask_flagged_on_stderr", + "eval.tests.test_orderbook.test_book_cross_sell_below_bid_flagged", + "eval.tests.test_orderbook.test_book_header_exact_for_two_levels", + "eval.tests.test_orderbook.test_buy_c_over_execution_negatives_old_price_level", + "eval.tests.test_orderbook.test_consistent_book_no_cross_diagnostic", + "eval.tests.test_orderbook.test_equal_bid_ask_price_is_not_a_cross", + "eval.tests.test_orderbook.test_execution_on_shared_price_level_keeps_sibling_size", + "eval.tests.test_orderbook.test_full_book_row_bid_and_ask", + "eval.tests.test_orderbook.test_fully_populated_three_level_grid_both_sides", + "eval.tests.test_orderbook.test_higher_bid_inserted_after_lower_reorders_to_best", + "eval.tests.test_orderbook.test_level_cap_truncates_deeper_levels[1]", + "eval.tests.test_orderbook.test_level_cap_truncates_deeper_levels[2]", + "eval.tests.test_orderbook.test_level_cap_truncates_deeper_levels[3]", + "eval.tests.test_orderbook.test_level_cap_truncates_deeper_levels[5]", + "eval.tests.test_orderbook.test_levels_one_single_bid_and_ask_columns", + "eval.tests.test_orderbook.test_lower_ask_inserted_after_higher_reorders_to_best", + "eval.tests.test_orderbook.test_multi_level_rows_emit_empty_cells_beyond_populated_price", + "eval.tests.test_orderbook.test_partial_cancel_on_shared_price_level_keeps_sibling", + "eval.tests.test_orderbook.test_price_display_formats[0.5-0.5]", + "eval.tests.test_orderbook.test_price_display_formats[10.0-10]", + "eval.tests.test_orderbook.test_price_display_formats[11.79-11.79]", + "eval.tests.test_orderbook.test_price_display_formats[12.5-12.5]", + "eval.tests.test_orderbook.test_price_display_formats[99.99-99.99]", + "eval.tests.test_orderbook.test_price_display_large_dollar_amount", + "eval.tests.test_orderbook.test_same_price_buys_aggregate_size", + "eval.tests.test_orderbook.test_same_price_sells_aggregate_size", + "eval.tests.test_orderbook.test_single_buy_add_shows_best_bid_only", + "eval.tests.test_orderbook.test_single_sell_add_shows_best_ask_only", + "eval.tests.test_orderbook.test_single_sided_book_is_never_crossed[B-orders0-200,9,50,,,8,50,,]", + "eval.tests.test_orderbook.test_single_sided_book_is_never_crossed[S-orders1-200,,,11,50,,,12,50]", + "eval.tests.test_orderbook.test_two_buy_levels_ordered_descending", + "eval.tests.test_orderbook.test_two_different_buys_distinct_levels", + "eval.tests.test_orderbook.test_two_sell_levels_ordered_ascending" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_book_consistency.test_crossed_book_exact_rows", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_book_consistency.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_book_consistency.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_book_constructor_orchestration.test_non_monotonic_timestamps_are_recorded_verbatim", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_book_constructor_orchestration.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_book_constructor_orchestration.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_reader_enrichment.test_balanced_three_level_book_exact", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_reader_enrichment.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_reader_enrichment.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_book_consistency.test_bid_above_ask_order_of_adds_matters", + "eval.tests.test_book_consistency.test_cross_detected_between_non_level_one_prices", + "eval.tests.test_book_consistency.test_crossed_bid_above_ask_emits_consistency_diagnostic", + "eval.tests.test_book_consistency.test_crossed_book_exact_rows", + "eval.tests.test_book_consistency.test_equal_best_bid_and_ask_is_not_crossed", + "eval.tests.test_book_consistency.test_prolonged_cross_emits_diagnostic_per_mutating_add", + "eval.tests.test_book_constructor_orchestration.test_feed_with_only_noop_frames_produces_headers_only", + "eval.tests.test_book_constructor_orchestration.test_full_cancel_then_readd_same_id_rebuilds_book", + "eval.tests.test_book_constructor_orchestration.test_levels_argument_yields_one_plus_four_times_levels_header_fields[1-5]", + "eval.tests.test_book_constructor_orchestration.test_levels_argument_yields_one_plus_four_times_levels_header_fields[15-61]", + "eval.tests.test_book_constructor_orchestration.test_levels_argument_yields_one_plus_four_times_levels_header_fields[30-121]", + "eval.tests.test_book_constructor_orchestration.test_nested_replace_chain_carries_mpid_and_old_fields_forward", + "eval.tests.test_book_constructor_orchestration.test_non_monotonic_timestamps_are_recorded_verbatim", + "eval.tests.test_book_constructor_orchestration.test_noop_frame_before_first_add_is_counted", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[B-18]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[I-49]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[J-34]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[K-27]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[L-25]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[N-19]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[Q-39]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[V-34]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[W-11]", + "eval.tests.test_book_constructor_orchestration.test_other_noop_frame_types_are_consumed_but_not_output[h-20]", + "eval.tests.test_book_constructor_orchestration.test_price_variant_execute_then_partial_cancel_of_remainder", + "eval.tests.test_book_constructor_orchestration.test_replace_makes_new_order_inherit_old_mpid", + "eval.tests.test_causal_chains.test_execute_clears_cross_and_stops_consistency_diagnostics", + "eval.tests.test_causal_chains.test_full_cancel_of_ask_clears_cross", + "eval.tests.test_causal_chains.test_mpid_propagates_to_price_variant_execution", + "eval.tests.test_causal_chains.test_partial_cancel_then_partial_execute_accumulates", + "eval.tests.test_causal_chains.test_re_add_after_full_cancel_rebuilds_volume", + "eval.tests.test_causal_chains.test_removing_top_ask_level_slides_next_level_up", + "eval.tests.test_causal_chains.test_removing_top_bid_level_slides_next_level_up", + "eval.tests.test_causal_chains.test_replace_then_full_execute_leaves_nothing", + "eval.tests.test_cli.test_book_data_rows_have_requested_number_of_levels", + "eval.tests.test_cli.test_extra_argument_is_ignored", + "eval.tests.test_cli.test_help_flag_is_not_a_subcommand", + "eval.tests.test_cli.test_levels_controls_book_header_columns", + "eval.tests.test_cli.test_levels_zero_produces_time_only_header", + "eval.tests.test_cli.test_no_arguments_prints_usage_and_fails", + "eval.tests.test_cli.test_non_numeric_levels_aborts", + "eval.tests.test_cli.test_non_numeric_levels_aborts_out_of_range", + "eval.tests.test_cli.test_output_files_are_named_from_input_basename_and_stock", + "eval.tests.test_cli.test_returncode_semantics_for_success", + "eval.tests.test_cli.test_too_few_arguments_prints_usage_and_fails[0]", + "eval.tests.test_cli.test_too_few_arguments_prints_usage_and_fails[1]", + "eval.tests.test_cli.test_too_few_arguments_prints_usage_and_fails[2]", + "eval.tests.test_cli.test_too_few_arguments_prints_usage_and_fails[3]", + "eval.tests.test_cli.test_valid_invocation_exit_zero_and_creates_outputs", + "eval.tests.test_deeper_book_scenarios.test_cancel_part_of_one_of_two_same_price_orders_reduces_level_volume", + "eval.tests.test_deeper_book_scenarios.test_full_price_variant_execute_removes_order_entirely", + "eval.tests.test_deeper_book_scenarios.test_reader_noop_system_types_are_counted_but_not_output[H-24]", + "eval.tests.test_deeper_book_scenarios.test_reader_noop_system_types_are_counted_but_not_output[R-38]", + "eval.tests.test_deeper_book_scenarios.test_reader_noop_system_types_are_counted_but_not_output[Y-19]", + "eval.tests.test_deeper_book_scenarios.test_same_price_f_adds_aggregate_volume_but_keep_mpids", + "eval.tests.test_deeper_book_scenarios.test_ten_level_book_header_has_forty_one_columns", + "eval.tests.test_deeper_book_scenarios.test_ten_level_deep_snapshot_interleaves_sides_and_pads_empty_tail", + "eval.tests.test_io.test_empty_input_file_yields_headers_only", + "eval.tests.test_io.test_input_file_is_a_directory_stops_reading", + "eval.tests.test_io.test_missing_input_file_reports_error_and_still_writes_headers", + "eval.tests.test_io.test_missing_output_directory_reports_writer_error", + "eval.tests.test_io.test_output_written_to_trailing_slash_directory", + "eval.tests.test_io.test_short_stock_argument_is_space_padded_to_match", + "eval.tests.test_io.test_stdout_closed_loop_markers_are_present", + "eval.tests.test_io.test_successful_run_creates_exactly_two_output_files", + "eval.tests.test_pool_closure.test_f_type_mpid_propagates_to_execution", + "eval.tests.test_pool_closure.test_f_type_mpid_propagates_to_matched_cancel", + "eval.tests.test_pool_closure.test_full_cancel_removes_id_from_pool", + "eval.tests.test_pool_closure.test_full_execution_removes_id_so_later_reference_is_dropped", + "eval.tests.test_pool_closure.test_mpid_survives_across_two_orders", + "eval.tests.test_pool_closure.test_multiple_open_orders_each_printed_after_closure_banner", + "eval.tests.test_pool_closure.test_no_banner_when_pool_is_empty_at_close", + "eval.tests.test_pool_closure.test_partial_execution_leaves_order_in_pool", + "eval.tests.test_pool_closure.test_remaining_ids_set_is_complete_regardless_of_add_order", + "eval.tests.test_pool_closure.test_replace_then_full_execute_of_new_id_clears_pool", + "eval.tests.test_reader_enrichment.test_balanced_three_level_book_exact", + "eval.tests.test_reader_enrichment.test_book_row_timestamp_uses_last_message_timestamp", + "eval.tests.test_reader_enrichment.test_empty_feed_reports_single_terminal_read", + "eval.tests.test_reader_enrichment.test_f_add_for_other_stock_is_filtered", + "eval.tests.test_reader_enrichment.test_levels_zero_writes_timestamp_only_book_rows", + "eval.tests.test_reader_enrichment.test_processed_count_is_frames_plus_terminal_eof", + "eval.tests.test_reader_enrichment.test_processed_count_parametrized[frames0-2]", + "eval.tests.test_reader_enrichment.test_processed_count_parametrized[frames1-4]", + "eval.tests.test_reader_enrichment.test_processed_count_scales_with_frame_count", + "eval.tests.test_reader_enrichment.test_system_event_s_between_orders_does_not_break_loop", + "eval.tests.test_reader_enrichment.test_system_event_s_consumed_but_not_output", + "eval.tests.test_reader_enrichment.test_unbalanced_book_fills_missing_side_with_empty_levels", + "eval.tests.test_reconstruction.test_add_ask_order_writes_ask_level", + "eval.tests.test_reconstruction.test_add_bid_order_writes_book_and_message_rows", + "eval.tests.test_reconstruction.test_add_open_orders_remain_in_pool_at_close", + "eval.tests.test_reconstruction.test_add_price_is_scaled_by_10000", + "eval.tests.test_reconstruction.test_add_same_price_two_sides_keeps_bid_and_ask_separate", + "eval.tests.test_reconstruction.test_add_with_mpid_records_mpid_field", + "eval.tests.test_reconstruction.test_best_bid_and_best_ask_reported_first", + "eval.tests.test_reconstruction.test_book_depth_truncates_beyond_requested_levels", + "eval.tests.test_reconstruction.test_cancel_larger_than_order_yields_negative_size", + "eval.tests.test_reconstruction.test_causal_chain_add_execute_replace_delete", + "eval.tests.test_reconstruction.test_complete_cancel_removes_order_and_reports_cancel_size", + "eval.tests.test_reconstruction.test_execute_at_price_reduces_book_at_original_price", + "eval.tests.test_reconstruction.test_execute_before_add_is_ignored", + "eval.tests.test_reconstruction.test_execution_larger_than_order_yields_negative_size", + "eval.tests.test_reconstruction.test_feed_for_unrequested_stock_produces_empty_outputs", + "eval.tests.test_reconstruction.test_full_execution_removes_order_and_empties_book", + "eval.tests.test_reconstruction.test_headers_match_module_contract", + "eval.tests.test_reconstruction.test_identical_price_orders_aggregate_volume", + "eval.tests.test_reconstruction.test_message_referencing_unknown_order_is_skipped", + "eval.tests.test_reconstruction.test_messages_for_other_stocks_are_discarded", + "eval.tests.test_reconstruction.test_non_displayable_trade_affects_message_but_not_book", + "eval.tests.test_reconstruction.test_partial_cancel_maps_to_delete_and_reduces_volume", + "eval.tests.test_reconstruction.test_partial_execution_reduces_volume_and_records_remaining", + "eval.tests.test_reconstruction.test_replace_cancels_old_id_and_adds_new", + "eval.tests.test_reconstruction.test_unknown_message_type_stops_processing" + ] + } + }, + "commit": "2c3ab0305ab51788ce3283d176e13d6b2910e62b", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.2523675144598987, + "eval_clean_hashes": [ + "40bdd3260e07c748be6fa23a9ffc844ec6e750e4139c4671f2a58d4c1b9054e1" + ], + "input_record": { + "commit": "2c3ab0305ab51788ce3283d176e13d6b2910e62b", + "difficulty": "easy", + "difficulty_code_lines": 1788, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1788, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.2523675144598987, + "difficulty_test_code_lines": 1013, + "full_name": "martinobdl/ITCH", + "input_joern_zip": "cpp_joern/martinobdl__ITCH.zip", + "joern_status": true, + "joern_time": 11.42928331415169, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "duckdb/duckdb", + "rank": 998, + "similarity": 0.4206571578979492 + } + ], + "repo_path": "cpp/martinobdl__ITCH", + "source": "commit:2c3ab0305ab51788ce3283d176e13d6b2910e62b", + "status": "done", + "url": "https://github.com/martinobdl/ITCH" + }, + "instance_id": "martinobdl__ITCH.2c3ab03", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "martinobdl/ITCH" +} diff --git a/martinobdl--itch.2c3ab03/tests/test.sh b/martinobdl--itch.2c3ab03/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/martinobdl--itch.2c3ab03/tests/workspace.tar.gz b/martinobdl--itch.2c3ab03/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4d2833270bb246d1dc5e75b303047b254f1b9cc3 --- /dev/null +++ b/martinobdl--itch.2c3ab03/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4af667c8306b289fe673904f5193fc5574be51ba00f39dd5c614ce23435e0b42 +size 8931 diff --git a/martinraison--ascii-tv.c0514a3/environment/Dockerfile b/martinraison--ascii-tv.c0514a3/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/martinraison--ascii-tv.c0514a3/environment/download.sh b/martinraison--ascii-tv.c0514a3/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..92980ddb9eb2d9cfb85875b052a91808e2ccc8eb --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/environment/download.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Manually recovered and independently validated ProgramGym build contract. +set -euo pipefail +mkdir -p /workspace/.programgym_build_env/go-prefetch +export GOTOOLCHAIN=auto +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF' +module github.com/martinraison/ascii-tv + +go 1.11 +PB_MANUAL_GO_MOD_EOF +cd /workspace/.programgym_build_env/go-prefetch +PB_RECOVERY_GOROOT="$(go env GOROOT)" +mkdir -p /opt/programgym-go-toolchain +cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/ +export GOROOT=/opt/programgym-go-toolchain +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all diff --git a/martinraison--ascii-tv.c0514a3/environment/executable b/martinraison--ascii-tv.c0514a3/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..8787f034d85cb4de5bb98102c7c8dedc889984e9 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ccc5cf3cb78ae2cc9af51bad7d1c5091588436c75912802e295875e304b8b9 +size 8211511 diff --git a/martinraison--ascii-tv.c0514a3/environment/programgym-go.tar.gz b/martinraison--ascii-tv.c0514a3/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/martinraison--ascii-tv.c0514a3/environment/workspace.tar.gz b/martinraison--ascii-tv.c0514a3/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b6b254f52e4e51220519e2132f42bcefe6976b4b --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64b0424acc3ac703a0b044a3dbea5a998a666712b2c16bd44619a2de93040960 +size 535 diff --git a/martinraison--ascii-tv.c0514a3/instruction.md b/martinraison--ascii-tv.c0514a3/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/martinraison--ascii-tv.c0514a3/solution/solve.sh b/martinraison--ascii-tv.c0514a3/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/martinraison--ascii-tv.c0514a3/task.toml b/martinraison--ascii-tv.c0514a3/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7782a03a86755f4f66aadad68b5d7444f730cb58 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/martinraison--ascii-tv.c0514a3" +description = "Synthetic ProgramGym cleanroom reconstruction task for martinraison/ascii-tv" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "martinraison__ascii-tv.c0514a3" +repository = "martinraison/ascii-tv" +commit = "c0514a33288e525ea9d6ed9daca6305836872089" +language = "go" +difficulty = "easy" +difficulty_score = 0.0 +test_branches = 1 +test_count = 63 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/martinraison--ascii-tv.c0514a3/tests/Dockerfile b/martinraison--ascii-tv.c0514a3/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/martinraison--ascii-tv.c0514a3/tests/blobs/tests/generated_module_01.tar.gz b/martinraison--ascii-tv.c0514a3/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3890aa1070924e8576cb3c81499ae94a96680560 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87a1c19cf6cfcd92d9d30a5e48cbf9ff477540b69f44d7e07d9a40d838af424d +size 11448 diff --git a/martinraison--ascii-tv.c0514a3/tests/download.sh b/martinraison--ascii-tv.c0514a3/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..92980ddb9eb2d9cfb85875b052a91808e2ccc8eb --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/download.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Manually recovered and independently validated ProgramGym build contract. +set -euo pipefail +mkdir -p /workspace/.programgym_build_env/go-prefetch +export GOTOOLCHAIN=auto +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PB_MANUAL_GO_MOD_EOF' +module github.com/martinraison/ascii-tv + +go 1.11 +PB_MANUAL_GO_MOD_EOF +cd /workspace/.programgym_build_env/go-prefetch +PB_RECOVERY_GOROOT="$(go env GOROOT)" +mkdir -p /opt/programgym-go-toolchain +cp -a "$PB_RECOVERY_GOROOT/." /opt/programgym-go-toolchain/ +export GOROOT=/opt/programgym-go-toolchain +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all diff --git a/martinraison--ascii-tv.c0514a3/tests/executable b/martinraison--ascii-tv.c0514a3/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..8787f034d85cb4de5bb98102c7c8dedc889984e9 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ccc5cf3cb78ae2cc9af51bad7d1c5091588436c75912802e295875e304b8b9 +size 8211511 diff --git a/martinraison--ascii-tv.c0514a3/tests/programgym-go.tar.gz b/martinraison--ascii-tv.c0514a3/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/martinraison--ascii-tv.c0514a3/tests/programgym_evaluator.py b/martinraison--ascii-tv.c0514a3/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/martinraison--ascii-tv.c0514a3/tests/programgym_task.json b/martinraison--ascii-tv.c0514a3/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..6f10874a3f988e2d8c5949cb41822ba41cef49b0 --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/programgym_task.json @@ -0,0 +1,144 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_main_edge_durations_and_addressing.test_bare_port_addr_listens_and_serves_curl_and_browser", + "reasons": [ + { + "id": "test_time_dependency", + "message": "test appears to depend on wall-clock time", + "path": "eval/tests/test_main_edge_durations_and_addressing.py", + "repair_hint": "Avoid wall-clock assertions or freeze/normalize time-dependent output.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_main.test_any_path_served_by_single_handler[/]", + "eval.tests.test_main.test_any_path_served_by_single_handler[/index.html]", + "eval.tests.test_main.test_any_path_served_by_single_handler[/some/path]", + "eval.tests.test_main.test_any_path_served_by_single_handler[/video]", + "eval.tests.test_main.test_browser_ua_returns_asciitv_message[Mozilla/5.0]", + "eval.tests.test_main.test_browser_ua_returns_asciitv_message[None]", + "eval.tests.test_main.test_browser_ua_returns_asciitv_message[Wget/1.20]", + "eval.tests.test_main.test_browser_ua_returns_asciitv_message[]", + "eval.tests.test_main.test_curl_detection_is_case_insensitive_substring[CURL/7.68]", + "eval.tests.test_main.test_curl_detection_is_case_insensitive_substring[curl/8.0]", + "eval.tests.test_main.test_curl_detection_is_case_insensitive_substring[libcurl/7.64]", + "eval.tests.test_main.test_curl_detection_is_case_insensitive_substring[notcurl-browser-ua]", + "eval.tests.test_main.test_curl_detection_is_case_insensitive_substring[xxCURLxy]", + "eval.tests.test_main.test_curl_stream_preserves_frame_content_and_order", + "eval.tests.test_main.test_curl_stream_to_non_root_path", + "eval.tests.test_main.test_curl_streams_all_frames_exact_body[1]", + "eval.tests.test_main.test_curl_streams_all_frames_exact_body[2]", + "eval.tests.test_main.test_curl_streams_all_frames_exact_body[3]", + "eval.tests.test_main.test_curl_streams_all_frames_exact_body[6]", + "eval.tests.test_main.test_default_movie_flag_uses_relative_path", + "eval.tests.test_main.test_duration_parse_error_still_streams_frame", + "eval.tests.test_main.test_extracted_frame_count_reported[1-1]", + "eval.tests.test_main.test_extracted_frame_count_reported[2-2]", + "eval.tests.test_main.test_extracted_frame_count_reported[3-3]", + "eval.tests.test_main.test_extracted_frame_count_reported[5-5]", + "eval.tests.test_main.test_help_flag_prints_usage", + "eval.tests.test_main.test_help_long_flag_also_prints_usage", + "eval.tests.test_main.test_invalid_bind_address_log_fatal[127.0.0.1:65536-invalid port]", + "eval.tests.test_main.test_invalid_bind_address_log_fatal[127.0.0.1:99999-invalid port]", + "eval.tests.test_main.test_malformed_movie_file_crashes[empty_file]", + "eval.tests.test_main.test_malformed_movie_file_crashes[missing_file]", + "eval.tests.test_main.test_malformed_movie_file_crashes[truncated_frame]", + "eval.tests.test_main.test_post_method_browser_message", + "eval.tests.test_main.test_response_content_type_for_browser", + "eval.tests.test_main.test_response_status_and_content_type_for_curl", + "eval.tests.test_main.test_server_serves_repeated_requests_including_curl", + "eval.tests.test_main.test_stream_body_contains_only_expected_frames", + "eval.tests.test_main.test_trailing_newline_alters_parser[False]", + "eval.tests.test_main.test_trailing_newline_alters_parser[True]", + "eval.tests.test_main.test_unknown_flag_exits_2[-doesnotexist]", + "eval.tests.test_main.test_unknown_flag_exits_2[-zzz]", + "eval.tests.test_main_edge_durations_and_addressing.test_bare_port_addr_listens_and_serves_curl_and_browser", + "eval.tests.test_main_edge_durations_and_addressing.test_concurrent_curl_requests_stream_identical_bodies", + "eval.tests.test_main_edge_durations_and_addressing.test_int64_extreme_duration_literal_parses[-9223372036854775808]", + "eval.tests.test_main_edge_durations_and_addressing.test_int64_extreme_duration_literal_parses[9223372036854775807]", + "eval.tests.test_main_edge_durations_and_addressing.test_int64_extreme_duration_overflow_reports_and_recovers[-9223372036854775809]", + "eval.tests.test_main_edge_durations_and_addressing.test_int64_extreme_duration_overflow_reports_and_recovers[9223372036854775808]", + "eval.tests.test_main_edge_durations_and_addressing.test_negative_duration_literal_parses", + "eval.tests.test_main_parsing_and_streaming.test_curl_blank_only_frame_streams_newlines", + "eval.tests.test_main_parsing_and_streaming.test_curl_streams_large_number_of_frames", + "eval.tests.test_main_parsing_and_streaming.test_duration_with_leading_whitespace_parse_error_recovers_and_exits", + "eval.tests.test_main_parsing_and_streaming.test_flag_order_is_independent", + "eval.tests.test_main_parsing_and_streaming.test_head_method_curl_runs_handler_with_empty_body", + "eval.tests.test_main_parsing_and_streaming.test_malformed_hex_literal_parse_error_recovers_and_exits", + "eval.tests.test_main_parsing_and_streaming.test_movie_flag_empty_string_seeks_empty_path", + "eval.tests.test_main_parsing_and_streaming.test_movie_path_is_directory_reports_load_failure", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[-0xA]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[010]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[0Xf]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[0]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[0b101]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[0o7]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[0xA]", + "eval.tests.test_main_parsing_and_streaming.test_zero_base_duration_literal_parses_without_error[42]" + ] + } + }, + "commit": "c0514a33288e525ea9d6ed9daca6305836872089", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 0.0, + "eval_clean_hashes": [ + "27ccc5cf3cb78ae2cc9af51bad7d1c5091588436c75912802e295875e304b8b9" + ], + "input_record": { + "commit": "c0514a33288e525ea9d6ed9daca6305836872089", + "commits": 7, + "contributors": 1, + "difficulty": "easy", + "difficulty_code_lines": 62, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 62, + "difficulty_runtime_deps": 0, + "difficulty_score": 0.0, + "difficulty_test_code_lines": 0, + "full_name": "martinraison/ascii-tv", + "github_stars": 367, + "input_joern_zip": "go_joern/martinraison__ascii-tv.zip", + "joern_status": true, + "joern_time": 6.777957868063822, + "language": "go", + "pb_match": [ + { + "pb_fullname": "rs/curlie", + "rank": 702, + "similarity": 0.48888495564460754 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 984, + "similarity": 0.4622148871421814 + } + ], + "repo_age": 7.54, + "repo_path": "go/martinraison__ascii-tv", + "source": "commit:c0514a33288e525ea9d6ed9daca6305836872089", + "status": "done", + "url": "https://github.com/martinraison/ascii-tv" + }, + "instance_id": "martinraison__ascii-tv.c0514a3", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "martinraison/ascii-tv" +} diff --git a/martinraison--ascii-tv.c0514a3/tests/test.sh b/martinraison--ascii-tv.c0514a3/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/martinraison--ascii-tv.c0514a3/tests/workspace.tar.gz b/martinraison--ascii-tv.c0514a3/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b6b254f52e4e51220519e2132f42bcefe6976b4b --- /dev/null +++ b/martinraison--ascii-tv.c0514a3/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64b0424acc3ac703a0b044a3dbea5a998a666712b2c16bd44619a2de93040960 +size 535 diff --git a/martinsos--edlib.0ddc23e/environment/Dockerfile b/martinsos--edlib.0ddc23e/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cd042aa1c8902da43f5e168d272841107895d27b --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/martinsos--edlib.0ddc23e/environment/docker-compose.yaml b/martinsos--edlib.0ddc23e/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinsos--edlib.0ddc23e/environment/download.sh b/martinsos--edlib.0ddc23e/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..eecf4ab366a11753aaef359b9bf6b671ff45bdc9 --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/download.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# download.sh for Martinsos/edlib +# +# Dependency-prepare / prefetch stage, intended to be SOURCED from the +# repository root: +# source /source_ro/download.sh +# +# This stage only prepares dependencies and exports environment variables that +# the later offline build.sh relies on. It performs NO compile, link, configure, +# test, or packaging step, and it never invokes the project's build tooling. +# +# edlib has no third-party external dependencies: the entire library is bundled +# in edlib/src/edlib.cpp with its public header edlib/include/edlib.h, and the +# selected aligner CLI (apps/aligner/aligner.cpp) only uses the C standard +# library, libstdc++, and this bundled library. The base build image already +# ships the required C++ compiler and the build system, so there is nothing to +# fetch. download.sh therefore only records that the toolchain/prefetch stage +# has run so build.sh can assert on it. + +# Be strict: surface real failures. Because this script is meant to be sourced, +# use 'return' instead of 'exit' when we are sourced, so we never kill the +# parent shell. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + PBD_DL_IS_SOURCED=0 +else + PBD_DL_IS_SOURCED=1 +fi + +# Report a failure: return 1 when sourced, exit 1 when run standalone. +fail() { + echo "[download.sh] ERROR: $*" >&2 + if [ "$PBD_DL_IS_SOURCED" = "1" ]; then + return 1 + fi + exit 1 +} + +# --- 1. No external dependencies ----------------------------------------- +# The edlib repository is self-contained. All build inputs live inside the +# repository tree (bundled edlib library + aligner source), and the toolchain +# required to build it is already present in the base image, so there is +# nothing to download, unpack, or prefetch here. Export the readiness marker +# that build.sh checks before starting its offline build. + +export PB_EDLIB_TOOLCHAIN_READY="1" + +# --- 2. Done -------------------------------------------------------------- +if [ "$PBD_DL_IS_SOURCED" != "1" ]; then + echo "[download.sh] edlib has no external dependencies; toolchain/stage marked ready." +fi diff --git a/martinsos--edlib.0ddc23e/environment/executable b/martinsos--edlib.0ddc23e/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..452ef95925c3bd0236d7cfa5772dc919e70a82cb --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a8f76f7777e1fc5b0d28f2eb2cb223077c2f3edfb2757cedfb002beb3e5fd31 +size 100448 diff --git a/martinsos--edlib.0ddc23e/environment/harbor_configure_apt_mirror.sh b/martinsos--edlib.0ddc23e/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinsos--edlib.0ddc23e/environment/harbor_prepare_download_env.sh b/martinsos--edlib.0ddc23e/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinsos--edlib.0ddc23e/environment/workspace.tar.gz b/martinsos--edlib.0ddc23e/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..96293601a422b0d927098af2a35af731c468d29c --- /dev/null +++ b/martinsos--edlib.0ddc23e/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fafb1433ca73b1571c7ce29463f787d5faebd3879e1ab757a07712a9c156111c +size 12592 diff --git a/martinsos--edlib.0ddc23e/instruction.md b/martinsos--edlib.0ddc23e/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/martinsos--edlib.0ddc23e/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/martinsos--edlib.0ddc23e/solution/solve.sh b/martinsos--edlib.0ddc23e/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/martinsos--edlib.0ddc23e/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/martinsos--edlib.0ddc23e/task.toml b/martinsos--edlib.0ddc23e/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2285ace7c3acf4c30d9e405cba40747798883fa0 --- /dev/null +++ b/martinsos--edlib.0ddc23e/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/martinsos--edlib.0ddc23e" +description = "Synthetic ProgramGym cleanroom reconstruction task for Martinsos/edlib" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "Martinsos__edlib.0ddc23e" +repository = "Martinsos/edlib" +commit = "0ddc23ea06abd95ab6227442acb4c27bd7607b68" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.3654879848908998 +test_branches = 1 +test_count = 140 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/martinsos--edlib.0ddc23e/tests/Dockerfile b/martinsos--edlib.0ddc23e/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ae6071510c9375ad35caf40d5f0fc02507509a77 --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip python3-dev autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/martinsos--edlib.0ddc23e/tests/blobs/tests/generated_module_03.tar.gz b/martinsos--edlib.0ddc23e/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ec0f4e5fb243bc198c736d17d7411a142c8a9d7a --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c00a5a229932da5fdc429380fa6f865e80614d485ad70057b9324df75be1f840 +size 19369 diff --git a/martinsos--edlib.0ddc23e/tests/docker-compose.yaml b/martinsos--edlib.0ddc23e/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/martinsos--edlib.0ddc23e/tests/download.sh b/martinsos--edlib.0ddc23e/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..eecf4ab366a11753aaef359b9bf6b671ff45bdc9 --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/download.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# download.sh for Martinsos/edlib +# +# Dependency-prepare / prefetch stage, intended to be SOURCED from the +# repository root: +# source /source_ro/download.sh +# +# This stage only prepares dependencies and exports environment variables that +# the later offline build.sh relies on. It performs NO compile, link, configure, +# test, or packaging step, and it never invokes the project's build tooling. +# +# edlib has no third-party external dependencies: the entire library is bundled +# in edlib/src/edlib.cpp with its public header edlib/include/edlib.h, and the +# selected aligner CLI (apps/aligner/aligner.cpp) only uses the C standard +# library, libstdc++, and this bundled library. The base build image already +# ships the required C++ compiler and the build system, so there is nothing to +# fetch. download.sh therefore only records that the toolchain/prefetch stage +# has run so build.sh can assert on it. + +# Be strict: surface real failures. Because this script is meant to be sourced, +# use 'return' instead of 'exit' when we are sourced, so we never kill the +# parent shell. +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + PBD_DL_IS_SOURCED=0 +else + PBD_DL_IS_SOURCED=1 +fi + +# Report a failure: return 1 when sourced, exit 1 when run standalone. +fail() { + echo "[download.sh] ERROR: $*" >&2 + if [ "$PBD_DL_IS_SOURCED" = "1" ]; then + return 1 + fi + exit 1 +} + +# --- 1. No external dependencies ----------------------------------------- +# The edlib repository is self-contained. All build inputs live inside the +# repository tree (bundled edlib library + aligner source), and the toolchain +# required to build it is already present in the base image, so there is +# nothing to download, unpack, or prefetch here. Export the readiness marker +# that build.sh checks before starting its offline build. + +export PB_EDLIB_TOOLCHAIN_READY="1" + +# --- 2. Done -------------------------------------------------------------- +if [ "$PBD_DL_IS_SOURCED" != "1" ]; then + echo "[download.sh] edlib has no external dependencies; toolchain/stage marked ready." +fi diff --git a/martinsos--edlib.0ddc23e/tests/executable b/martinsos--edlib.0ddc23e/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..452ef95925c3bd0236d7cfa5772dc919e70a82cb --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a8f76f7777e1fc5b0d28f2eb2cb223077c2f3edfb2757cedfb002beb3e5fd31 +size 100448 diff --git a/martinsos--edlib.0ddc23e/tests/harbor_configure_apt_mirror.sh b/martinsos--edlib.0ddc23e/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/martinsos--edlib.0ddc23e/tests/harbor_prepare_download_env.sh b/martinsos--edlib.0ddc23e/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/martinsos--edlib.0ddc23e/tests/programgym_evaluator.py b/martinsos--edlib.0ddc23e/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/martinsos--edlib.0ddc23e/tests/programgym_task.json b/martinsos--edlib.0ddc23e/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..4622f1d54803bfbf78516d70570f16062d58f395 --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/programgym_task.json @@ -0,0 +1,223 @@ +{ + "branches": { + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_best_scores.test_default_header_is_scores_not_best_scores", + "eval.tests.test_best_scores.test_default_lists_all_score_rows_as_full_output", + "eval.tests.test_best_scores.test_k0_keeps_only_exact_scoring_rows", + "eval.tests.test_best_scores.test_k4_keeps_scores_within_threshold", + "eval.tests.test_best_scores.test_k_m1_keeps_everything_rows", + "eval.tests.test_best_scores.test_n0_means_all_scores_rows", + "eval.tests.test_best_scores.test_n1_keeps_only_single_best_row", + "eval.tests.test_best_scores.test_n2_keeps_two_smallest_rows", + "eval.tests.test_best_scores.test_n2_with_locations_resolves_start_index", + "eval.tests.test_best_scores.test_n_and_k_combined_keep_best_within_threshold", + "eval.tests.test_best_scores.test_n_exceeding_query_count_lists_all_rows", + "eval.tests.test_best_scores.test_n_keeps_more_queries_than_best_by_pruning", + "eval.tests.test_best_scores.test_pop_evicts_high_score_when_third_query_below_window", + "eval.tests.test_cli_arguments.test_help_long_flag_is_rejected", + "eval.tests.test_cli_arguments.test_no_arguments_prints_usage_and_exits_nonzero", + "eval.tests.test_cli_arguments.test_one_argument_prints_usage_and_exits_nonzero", + "eval.tests.test_cli_arguments.test_three_arguments_prints_usage_and_exits_nonzero", + "eval.tests.test_cli_arguments.test_unknown_option_prints_usage_and_exits_nonzero", + "eval.tests.test_cli_arguments.test_usage_goes_to_stderr_not_stdout", + "eval.tests.test_cli_arguments.test_usage_text_documents_each_option_line", + "eval.tests.test_cli_arguments.test_valid_invocation_returns_zero_and_runs", + "eval.tests.test_fasta_reading.test_crlf_line_endings_are_tolerated", + "eval.tests.test_fasta_reading.test_empty_query_file_counts_zero_residues", + "eval.tests.test_fasta_reading.test_headers_are_not_counted_as_residues", + "eval.tests.test_fasta_reading.test_missing_query_file_reports_exact_error", + "eval.tests.test_fasta_reading.test_missing_target_file_reports_exact_error", + "eval.tests.test_fasta_reading.test_multi_query_counts_summed_residues", + "eval.tests.test_fasta_reading.test_multi_sequence_target_uses_first_only", + "eval.tests.test_fasta_reading.test_no_trailing_newline_is_fine", + "eval.tests.test_fasta_reading.test_non_residue_whitespace_and_digits_count_as_residues", + "eval.tests.test_fasta_reading.test_query_error_exits_before_target_read", + "eval.tests.test_fasta_reading.test_single_base_query_is_aligned", + "eval.tests.test_fasta_reading.test_single_query_counts_residues", + "eval.tests.test_fasta_reading.test_target_residues_reported", + "eval.tests.test_fasta_reading.test_wrapped_multi_line_sequence_joined", + "eval.tests.test_format_validation.test_cig_formats_emit_cigar_header[CIG_EXT-8=]", + "eval.tests.test_format_validation.test_cig_formats_emit_cigar_header[CIG_STD-8M]", + "eval.tests.test_format_validation.test_format_error_checked_before_mode_error", + "eval.tests.test_format_validation.test_format_validation_runs_before_file_io", + "eval.tests.test_format_validation.test_format_without_path_flag_never_emits_cigar", + "eval.tests.test_format_validation.test_formats_are_case_sensitive[Cig_Std]", + "eval.tests.test_format_validation.test_formats_are_case_sensitive[Nice]", + "eval.tests.test_format_validation.test_formats_are_case_sensitive[cig_ext]", + "eval.tests.test_format_validation.test_formats_are_case_sensitive[cig_std]", + "eval.tests.test_format_validation.test_formats_are_case_sensitive[nice]", + "eval.tests.test_format_validation.test_invalid_format_rejected_with_exact_error", + "eval.tests.test_format_validation.test_nice_format_emits_nice_rows_not_cigar", + "eval.tests.test_golden_output.test_golden_best_n2_k0_matches", + "eval.tests.test_golden_output.test_golden_best_n2_matches", + "eval.tests.test_golden_output.test_golden_best_n2_with_locations_matches", + "eval.tests.test_golden_output.test_golden_cig_ext_matches", + "eval.tests.test_golden_output.test_golden_cig_std_all_matches", + "eval.tests.test_golden_output.test_golden_cig_std_matches", + "eval.tests.test_golden_output.test_golden_default_nw_matches", + "eval.tests.test_golden_output.test_golden_files_are_not_regenerated_at_runtime", + "eval.tests.test_golden_output.test_golden_hw_mode_matches", + "eval.tests.test_golden_output.test_golden_nice_path_matches", + "eval.tests.test_golden_output.test_golden_nw_locations_matches", + "eval.tests.test_golden_output.test_golden_pruned_k4_matches", + "eval.tests.test_golden_output.test_golden_shw_mode_matches", + "eval.tests.test_golden_output.test_golden_shw_path_matches", + "eval.tests.test_golden_output.test_golden_silent_matches", + "eval.tests.test_mode_validation.test_exact_match_scores_zero_in_every_mode", + "eval.tests.test_mode_validation.test_hw_mode_accepts_score_output", + "eval.tests.test_mode_validation.test_hw_mode_differs_from_nw_on_partial_overlap", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_before_reading_files", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[FM]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[NWX]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[N]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[SHWW]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[W]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[XX]", + "eval.tests.test_mode_validation.test_invalid_mode_rejected_with_exact_error[global]", + "eval.tests.test_mode_validation.test_modes_are_case_sensitive[Nw]", + "eval.tests.test_mode_validation.test_modes_are_case_sensitive[hw]", + "eval.tests.test_mode_validation.test_modes_are_case_sensitive[nW]", + "eval.tests.test_mode_validation.test_modes_are_case_sensitive[nw]", + "eval.tests.test_mode_validation.test_modes_are_case_sensitive[shw]", + "eval.tests.test_mode_validation.test_valid_mode_is_echoed_exactly[HW]", + "eval.tests.test_mode_validation.test_valid_mode_is_echoed_exactly[NW]", + "eval.tests.test_mode_validation.test_valid_mode_is_echoed_exactly[SHW]", + "eval.tests.test_numeric_arg_edges.test_format_last_occurrence_wins", + "eval.tests.test_numeric_arg_edges.test_k_larger_than_all_scores_keeps_every_row", + "eval.tests.test_numeric_arg_edges.test_k_last_occurrence_wins", + "eval.tests.test_numeric_arg_edges.test_mode_last_occurrence_wins", + "eval.tests.test_numeric_arg_edges.test_n_accepts_leading_plus_sign_as_positive", + "eval.tests.test_numeric_arg_edges.test_n_last_occurrence_wins", + "eval.tests.test_numeric_arg_edges.test_negative_n_falls_back_to_all_rows", + "eval.tests.test_numeric_arg_edges.test_non_numeric_n_parses_as_zero", + "eval.tests.test_numeric_arg_edges.test_repeat_last_occurrence_wins", + "eval.tests.test_orchestration.test_combined_flags_mask_runs_deterministically", + "eval.tests.test_orchestration.test_location_task_reports_numeric_starts", + "eval.tests.test_orchestration.test_multi_query_iteration_reports_progress_counters", + "eval.tests.test_orchestration.test_n_loc_precedence_resolves_start_then_path", + "eval.tests.test_orchestration.test_p_and_l_together_prefers_path_output", + "eval.tests.test_orchestration.test_path_output_emitted_for_each_query_in_order", + "eval.tests.test_orchestration.test_repeat_flag_produces_identical_full_output", + "eval.tests.test_orchestration.test_repeat_silent_is_stable", + "eval.tests.test_path_output.test_cig_ext_distinguishes_match_and_mismatch", + "eval.tests.test_path_output.test_cig_ext_exact_match_is_equals_ops", + "eval.tests.test_path_output.test_cig_ext_insertion_deletion_and_indel_operators[ACG-ACGTAAAA-3=5D]", + "eval.tests.test_path_output.test_cig_ext_insertion_deletion_and_indel_operators[ACGTAAAAACGT-ACGTAAACGT-7=2I3=]", + "eval.tests.test_path_output.test_cig_ext_insertion_deletion_and_indel_operators[ACGTAT-ACGTGT-4=1X1=]", + "eval.tests.test_path_output.test_cig_std_exact_match_is_all_matches", + "eval.tests.test_path_output.test_cig_std_query_longer_than_target_yields_insertions", + "eval.tests.test_path_output.test_cig_std_with_deletion_op", + "eval.tests.test_path_output.test_cig_std_with_insertion_op", + "eval.tests.test_path_output.test_cigar_header_only_during_std_and_ext_not_nice", + "eval.tests.test_path_output.test_hw_mode_path_uses_hw_coordinate_offset", + "eval.tests.test_path_output.test_mismatch_middle_shows_gap_not_pipe", + "eval.tests.test_path_output.test_nice_prints_target_match_and_query_rows", + "eval.tests.test_path_output.test_nice_reports_multiple_coordinate_windows", + "eval.tests.test_path_output.test_path_header_reports_query_number_length_and_score", + "eval.tests.test_path_output.test_path_output_not_emitted_without_p_flag", + "eval.tests.test_path_output.test_path_task_with_no_alignment_in_window_emits_nothing", + "eval.tests.test_path_output.test_path_with_shorter_query_than_target", + "eval.tests.test_path_output.test_shw_mode_path_output_is_emitted", + "eval.tests.test_path_precedence_and_mixed.test_mixed_aligned_and_window_rejected_queries_under_p", + "eval.tests.test_path_precedence_and_mixed.test_nice_block_shows_target_and_query_dashes_together", + "eval.tests.test_path_precedence_and_mixed.test_path_mode_suppresses_n_driven_score_section", + "eval.tests.test_scores_output.test_cpu_time_trailer_present", + "eval.tests.test_scores_output.test_exact_match_score_zero_and_single_location", + "eval.tests.test_scores_output.test_exact_mismatch_row_reports_full_format", + "eval.tests.test_scores_output.test_header_only_query_is_zero_queries", + "eval.tests.test_scores_output.test_hw_mode_reports_multiple_start_locations", + "eval.tests.test_scores_output.test_l_resolves_start_location_index", + "eval.tests.test_scores_output.test_l_start_and_end_index_shown", + "eval.tests.test_scores_output.test_mismatch_produces_nonzero_score", + "eval.tests.test_scores_output.test_multi_query_reports_one_row_per_query_in_order", + "eval.tests.test_scores_output.test_num_locations_column_equals_bracket_pair_count", + "eval.tests.test_scores_output.test_score_header_is_scores_by_default", + "eval.tests.test_scores_output.test_shw_mode_reports_multiple_start_locations", + "eval.tests.test_scores_output.test_start_location_unresolved_without_l", + "eval.tests.test_silent_mode.test_silent_keeps_cpu_time_summary", + "eval.tests.test_silent_mode.test_silent_keeps_reading_and_mode_lines", + "eval.tests.test_silent_mode.test_silent_reports_query_progress_counter", + "eval.tests.test_silent_mode.test_silent_suppresses_alignment_with_l", + "eval.tests.test_silent_mode.test_silent_suppresses_path_even_with_p_flag", + "eval.tests.test_silent_mode.test_silent_suppresses_score_rows_and_header", + "eval.tests.test_silent_mode.test_silent_with_n_and_k_runs_and_stays_quiet" + ] + } + }, + "commit": "0ddc23ea06abd95ab6227442acb4c27bd7607b68", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.3654879848908998, + "eval_clean_hashes": [ + "9a8f76f7777e1fc5b0d28f2eb2cb223077c2f3edfb2757cedfb002beb3e5fd31" + ], + "input_record": { + "commit": "0ddc23ea06abd95ab6227442acb4c27bd7607b68", + "difficulty": "easy", + "difficulty_code_lines": 2320, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 2320, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.3654879848908998, + "difficulty_test_code_lines": 775, + "full_name": "Martinsos/edlib", + "input_joern_zip": "cpp_joern/Martinsos__edlib.zip", + "joern_status": true, + "joern_time": 15.334317592903972, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 197, + "similarity": 0.5097548961639404 + }, + { + "pb_fullname": "facebookresearch/fastText", + "rank": 638, + "similarity": 0.4444850981235504 + }, + { + "pb_fullname": "ninja-build/ninja", + "rank": 148, + "similarity": 0.4803323745727539 + } + ], + "repo_path": "cpp/Martinsos__edlib", + "source": "commit:0ddc23ea06abd95ab6227442acb4c27bd7607b68", + "status": "done", + "url": "https://github.com/Martinsos/edlib" + }, + "instance_id": "Martinsos__edlib.0ddc23e", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "Martinsos/edlib" +} diff --git a/martinsos--edlib.0ddc23e/tests/test.sh b/martinsos--edlib.0ddc23e/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/martinsos--edlib.0ddc23e/tests/workspace.tar.gz b/martinsos--edlib.0ddc23e/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..96293601a422b0d927098af2a35af731c468d29c --- /dev/null +++ b/martinsos--edlib.0ddc23e/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fafb1433ca73b1571c7ce29463f787d5faebd3879e1ab757a07712a9c156111c +size 12592 diff --git a/masterminds--structable.a1a302e/environment/Dockerfile b/masterminds--structable.a1a302e/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/masterminds--structable.a1a302e/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/masterminds--structable.a1a302e/environment/download.sh b/masterminds--structable.a1a302e/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..bda47865b400425978cb3094709b9f7ad442e31b --- /dev/null +++ b/masterminds--structable.a1a302e/environment/download.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# PROGRAMGYM dependency download for github.com/Masterminds/structable. +# +# This repository uses a legacy Glide layout (glide.yaml / glide.lock) with no +# go.mod, no go.sum, and no populated vendor/ tree. Dependency metadata is +# therefore embedded below so the Go module cache can be prefetched offline. +# +# download.sh is a standalone, idempotent, source-safe file. It is executed +# via `source /source_ro/download.sh`, so it only exports environment variables +# and prepares the module cache -- it performs NO compilation or building. +# +# The Go module cache is populated at a fixed literal directory so the +# `go mod download -modfile` argument is a statically-verifiable literal path +# to an inline-generated go.mod. + +# Public module proxy for the networked stage; applied to the download below. +export GOPROXY="https://proxy.golang.org,direct" +# No network and no checksum database needed for the offline build that follows. +export GOSUMDB="off" + +# Fixed literal directory holding the inline-generated module metadata used to +# drive `go mod download`. This is created by download.sh itself and is never +# read from the repository mount. +mkdir -p /tmp/programgym_structable_mod + +cat > /tmp/programgym_structable_mod/go.mod <<'PROGRAMGYM_EOF' +module github.com/Masterminds/structable + +go 1.25 + +require ( + github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5 // indirect + github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 // indirect + github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect + github.com/lib/pq v0.0.0-20170103192009-8df6253d1317 // indirect +) +PROGRAMGYM_EOF + +cat > /tmp/programgym_structable_mod/go.sum <<'PROGRAMGYM_EOF' +github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5 h1:PPfYWScYacO3Q6JMCLkyh6Ea2Q/REDTMgmiTAeiV8Jg= +github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5/go.mod h1:xnKTFzjGUiZtiOagBsfnvomW+nJg2usB1ZpordQWqNM= +github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 h1:yZJImkCmVI6d1uJ9KRRf/96YbFLDQ/hhs6Xt9Z3OBXI= +github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/lib/pq v0.0.0-20170103192009-8df6253d1317 h1:QfWEYA9/r1gkhuMk6bLk8kPXek0/mxHCzLKcR/kkcL8= +github.com/lib/pq v0.0.0-20170103192009-8df6253d1317/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +PROGRAMGYM_EOF + +# Populate the module cache from the generated metadata. A cd into the literal +# module directory is required because Go discovers the module root from the +# working directory, and the -modfile argument is a full literal path so it +# resolves to the inline-generated go.mod above. Run in a subshell so the cd +# does not change the caller's directory when this file is sourced; inside the +# subshell each step's failure is propagated via an explicit `exit`. +( + cd /tmp/programgym_structable_mod || exit 1 + go mod download -modfile /tmp/programgym_structable_mod/go.mod || exit 1 +) + +# Propagate any subshell failure as a real error from this sourced script. +if [ $? -ne 0 ]; then + echo "download.sh: go mod download failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# build.sh subsequently builds ./example offline into ./executable from the +# module cache prepared here. diff --git a/masterminds--structable.a1a302e/environment/executable b/masterminds--structable.a1a302e/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..cdc8d3a99241488dce2e854d9ae14a343ec24be2 --- /dev/null +++ b/masterminds--structable.a1a302e/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e80039426e40897d286d0cbaccc1445b60e8fc6e3f0c5dbbc79445674277829 +size 7597306 diff --git a/masterminds--structable.a1a302e/environment/programgym-go.tar.gz b/masterminds--structable.a1a302e/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/masterminds--structable.a1a302e/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/masterminds--structable.a1a302e/environment/workspace.tar.gz b/masterminds--structable.a1a302e/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b18124a306f8b7f47e52e932f62d67be1cb8cef7 --- /dev/null +++ b/masterminds--structable.a1a302e/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:924decbf27be051c8b1f1f990f76cef4124aecfa0d37d97eca795ac0178f9c90 +size 4987 diff --git a/masterminds--structable.a1a302e/instruction.md b/masterminds--structable.a1a302e/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/masterminds--structable.a1a302e/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/masterminds--structable.a1a302e/solution/solve.sh b/masterminds--structable.a1a302e/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/masterminds--structable.a1a302e/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/masterminds--structable.a1a302e/task.toml b/masterminds--structable.a1a302e/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1786ac10ce8e080f661e89c394a39a85d40b19b0 --- /dev/null +++ b/masterminds--structable.a1a302e/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/masterminds--structable.a1a302e" +description = "Synthetic ProgramGym cleanroom reconstruction task for Masterminds/structable" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "Masterminds__structable.a1a302e" +repository = "Masterminds/structable" +commit = "a1a302ef78ec3d85606dcf104a9a168542004036" +language = "go" +difficulty = "easy" +difficulty_score = 1.0965624383741357 +test_branches = 3 +test_count = 364 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/masterminds--structable.a1a302e/tests/Dockerfile b/masterminds--structable.a1a302e/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_01.tar.gz b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..27cb3fa847d9a6a25ed52a7ad5e8b82f9f2a4d3e --- /dev/null +++ b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b2c7b6aa3966cf82444f48a0dc751f588aee0fdf7472e0f2512575dea6f6790 +size 18321 diff --git a/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_02.tar.gz b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d57546b6723c99261dd1586efde6d901df5322c8 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b099e255775b82abc8eb69467247a9cb44abcc119e7c0f96ff32498dd2c1460 +size 20407 diff --git a/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_03.tar.gz b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..90671df01768035a7780d0ac30a5f98383155485 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9c9a74c018d745f43c2a3972b708f34c0a5b705349f89d2c8a3e7c130cb53cb +size 14449 diff --git a/masterminds--structable.a1a302e/tests/download.sh b/masterminds--structable.a1a302e/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..bda47865b400425978cb3094709b9f7ad442e31b --- /dev/null +++ b/masterminds--structable.a1a302e/tests/download.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# PROGRAMGYM dependency download for github.com/Masterminds/structable. +# +# This repository uses a legacy Glide layout (glide.yaml / glide.lock) with no +# go.mod, no go.sum, and no populated vendor/ tree. Dependency metadata is +# therefore embedded below so the Go module cache can be prefetched offline. +# +# download.sh is a standalone, idempotent, source-safe file. It is executed +# via `source /source_ro/download.sh`, so it only exports environment variables +# and prepares the module cache -- it performs NO compilation or building. +# +# The Go module cache is populated at a fixed literal directory so the +# `go mod download -modfile` argument is a statically-verifiable literal path +# to an inline-generated go.mod. + +# Public module proxy for the networked stage; applied to the download below. +export GOPROXY="https://proxy.golang.org,direct" +# No network and no checksum database needed for the offline build that follows. +export GOSUMDB="off" + +# Fixed literal directory holding the inline-generated module metadata used to +# drive `go mod download`. This is created by download.sh itself and is never +# read from the repository mount. +mkdir -p /tmp/programgym_structable_mod + +cat > /tmp/programgym_structable_mod/go.mod <<'PROGRAMGYM_EOF' +module github.com/Masterminds/structable + +go 1.25 + +require ( + github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5 // indirect + github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 // indirect + github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect + github.com/lib/pq v0.0.0-20170103192009-8df6253d1317 // indirect +) +PROGRAMGYM_EOF + +cat > /tmp/programgym_structable_mod/go.sum <<'PROGRAMGYM_EOF' +github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5 h1:PPfYWScYacO3Q6JMCLkyh6Ea2Q/REDTMgmiTAeiV8Jg= +github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5/go.mod h1:xnKTFzjGUiZtiOagBsfnvomW+nJg2usB1ZpordQWqNM= +github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939 h1:yZJImkCmVI6d1uJ9KRRf/96YbFLDQ/hhs6Xt9Z3OBXI= +github.com/lann/builder v0.0.0-20150808151131-f22ce00fd939/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/lib/pq v0.0.0-20170103192009-8df6253d1317 h1:QfWEYA9/r1gkhuMk6bLk8kPXek0/mxHCzLKcR/kkcL8= +github.com/lib/pq v0.0.0-20170103192009-8df6253d1317/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +PROGRAMGYM_EOF + +# Populate the module cache from the generated metadata. A cd into the literal +# module directory is required because Go discovers the module root from the +# working directory, and the -modfile argument is a full literal path so it +# resolves to the inline-generated go.mod above. Run in a subshell so the cd +# does not change the caller's directory when this file is sourced; inside the +# subshell each step's failure is propagated via an explicit `exit`. +( + cd /tmp/programgym_structable_mod || exit 1 + go mod download -modfile /tmp/programgym_structable_mod/go.mod || exit 1 +) + +# Propagate any subshell failure as a real error from this sourced script. +if [ $? -ne 0 ]; then + echo "download.sh: go mod download failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +# build.sh subsequently builds ./example offline into ./executable from the +# module cache prepared here. diff --git a/masterminds--structable.a1a302e/tests/executable b/masterminds--structable.a1a302e/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..cdc8d3a99241488dce2e854d9ae14a343ec24be2 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e80039426e40897d286d0cbaccc1445b60e8fc6e3f0c5dbbc79445674277829 +size 7597306 diff --git a/masterminds--structable.a1a302e/tests/programgym-go.tar.gz b/masterminds--structable.a1a302e/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/masterminds--structable.a1a302e/tests/programgym_evaluator.py b/masterminds--structable.a1a302e/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/masterminds--structable.a1a302e/tests/programgym_task.json b/masterminds--structable.a1a302e/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..dcef8264ef2567ed0307e5b3c7e14ae3b0b6bf83 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/programgym_task.json @@ -0,0 +1,475 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_structable_demo_combined.test_combined_keeps_stdout_empty_and_panic_anchored", + "eval.tests.test_structable_demo_combined.test_dns_failure_dominates_over_valid_port", + "eval.tests.test_structable_demo_combined.test_empty_host_with_explicit_port", + "eval.tests.test_structable_demo_combined.test_host_and_port_compose", + "eval.tests.test_structable_demo_combined.test_ipv6_host_and_port_compose", + "eval.tests.test_structable_demo_combined.test_literal_host_and_default_port_composition", + "eval.tests.test_structable_demo_combined.test_malformed_port_applies_on_resolvable_host", + "eval.tests.test_structable_demo_combined.test_port_override_beats_default_on_localhost", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_empty_defaults_to_dial", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_dominates_tcp_dial", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_dominates_unix_dial", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_names_the_token", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_preserves_panic_page", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[1.0-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"1.0\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[2.5-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"2.5\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[5_-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"5_\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[_5-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"_5\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[_x_y_-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"_x_y_\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[abc-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"abc\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_invalid_value_rejected_verbatim[xyz-panic:_invalid_value_for_parameter_connect_timeout:_strconv.ParseInt:_parsing_\"xyz\":_invalid_syntax]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_on_unix_socket", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_preserves_panic_page", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_yields_io_timeout[-1]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_yields_io_timeout[-2]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_yields_io_timeout[-50]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_negative_yields_io_timeout[-999999]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[0-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[01-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[1-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[500-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[999999999-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_connect_timeout_nonnegative_proceeds_to_connection_refused[plus-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_connect_timeout.test_datestyle_error_dominates_connect_timeout_validation", + "eval.tests.test_structable_demo_connect_timeout.test_unsupported_key_error_dominates_connect_timeout_validation", + "eval.tests.test_structable_demo_datestyle.test_additional_unsupported_key_preserves_framing[PGGSSLIB]", + "eval.tests.test_structable_demo_datestyle.test_additional_unsupported_key_preserves_framing[PGHOSTADDR]", + "eval.tests.test_structable_demo_datestyle.test_additional_unsupported_key_rejected_before_dial[PGGSSLIB-gss]", + "eval.tests.test_structable_demo_datestyle.test_additional_unsupported_key_rejected_before_dial[PGHOSTADDR-1.2.3.4]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_accepted_value_proceeds_to_dial[-0.0.0.0-2-panic: dial tcp 0.0.0.0:2: connect: connection refused]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_accepted_value_proceeds_to_dial[ISO, MDY-127.0.0.1-1-panic: dial tcp 127.0.0.1:1: connect: connection refused]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_default_absent_value_accepted", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[ISO,DMY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_ISO,DMY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[ISO,MDY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_ISO,MDY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[ISO,TABMDY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_ISO,\\\\tMDY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[ISO,_MDY_-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_ISO,_MDY_\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[MDY,_ISO-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_MDY,_ISO\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[Postgres,_MDY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_Postgres,_MDY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[SQL,_DMY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_SQL,_DMY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[SQL,_MDY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_SQL,_MDY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[__ISO,_MDY-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got___ISO,_MDY\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[iso,_mdy-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_iso,_mdy\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejected_value_is_quoted_verbatim[xyz-panic:_pq:_unexpected_error:_\"setting_datestyle_must_be_absent_or_ISO,_MDY;_got_xyz\"]", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejection_dominates_tcp_dial", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejection_dominates_unix_socket_dial", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejection_names_the_value", + "eval.tests.test_structable_demo_datestyle.test_datestyle_rejection_preserves_panic_page", + "eval.tests.test_structable_demo_datestyle.test_unsupported_key_error_dominates_datestyle_rejection", + "eval.tests.test_structable_demo_edge_cases.test_dial_detail_always_renders_on_first_line", + "eval.tests.test_structable_demo_edge_cases.test_edge_cases_never_emit_stdout", + "eval.tests.test_structable_demo_edge_cases.test_empty_host_and_empty_port_dial_wildcard", + "eval.tests.test_structable_demo_edge_cases.test_host_only_loopback_and_default_port", + "eval.tests.test_structable_demo_edge_cases.test_inner_whitespace_host_is_preserved", + "eval.tests.test_structable_demo_edge_cases.test_link_local_host_fails_immediately_not_hang", + "eval.tests.test_structable_demo_edge_cases.test_port_with_leading_whitespace_is_trimmed", + "eval.tests.test_structable_demo_edge_cases.test_whitespace_host_with_port_still_dns_fails", + "eval.tests.test_structable_demo_edge_cases.test_whitespace_only_host_fails_dns_resolution", + "eval.tests.test_structable_demo_host_discriminant.test_leading_slash_still_selects_unix_branch", + "eval.tests.test_structable_demo_host_discriminant.test_non_slash_path_like_host_is_dns_lookup[../pg-panic: dial tcp: lookup ../pg: no such host]", + "eval.tests.test_structable_demo_host_discriminant.test_non_slash_path_like_host_is_dns_lookup[./pg-panic: dial tcp: lookup ./pg: no such host]", + "eval.tests.test_structable_demo_host_discriminant.test_non_slash_path_like_host_is_dns_lookup[pg~-panic: dial tcp: lookup pg~: no such host]", + "eval.tests.test_structable_demo_host_discriminant.test_non_slash_path_like_host_is_dns_lookup[~/pg-panic: dial tcp: lookup ~/pg: no such host]", + "eval.tests.test_structable_demo_host_discriminant.test_path_like_host_never_reports_socket_failure", + "eval.tests.test_structable_demo_host_discriminant.test_path_like_host_preserves_panic_framing", + "eval.tests.test_structable_demo_host_matrix.test_dns_failure_preserves_panic_framing", + "eval.tests.test_structable_demo_host_matrix.test_host_default_is_ipv6_loopback_port_5432", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[ -panic: dial tcp: lookup : no such host]", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[-panic: dial tcp :5432: connect: connection refused]", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[0.0.0.0-panic: dial tcp 0.0.0.0:5432: connect: connection refused]", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[127.0.0.1-panic: dial tcp 127.0.0.1:5432: connect: connection refused]", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[::1-panic: dial tcp [::1]:5432: connect: connection refused]", + "eval.tests.test_structable_demo_host_matrix.test_host_dial_target[localhost-panic: dial tcp [::1]:5432: connect: connection refused]", + "eval.tests.test_structable_demo_host_matrix.test_host_does_not_touch_stdout_or_source_path", + "eval.tests.test_structable_demo_host_matrix.test_host_explicit_default_port_is_stable", + "eval.tests.test_structable_demo_host_matrix.test_host_ipv6_linklocal_reports_invalid_argument", + "eval.tests.test_structable_demo_host_matrix.test_unresolvable_host_yields_lookup_failure[ ]", + "eval.tests.test_structable_demo_host_matrix.test_unresolvable_host_yields_lookup_failure[definitely-not-a-real-host.example]", + "eval.tests.test_structable_demo_host_matrix.test_unresolvable_host_yields_lookup_failure[no-such-host.invalid]", + "eval.tests.test_structable_demo_invocation.test_default_panic_message_connection_refused", + "eval.tests.test_structable_demo_invocation.test_exit_code_is_two", + "eval.tests.test_structable_demo_invocation.test_goroutine_header_precedes_function_frame", + "eval.tests.test_structable_demo_invocation.test_help_flag_does_not_change_behavior", + "eval.tests.test_structable_demo_invocation.test_no_hanging_smoke_terminates_under_timeout", + "eval.tests.test_structable_demo_invocation.test_output_is_deterministic_across_runs", + "eval.tests.test_structable_demo_invocation.test_panic_page_is_five_lines", + "eval.tests.test_structable_demo_invocation.test_stderr_fully_streamed_to_stderr_handle", + "eval.tests.test_structable_demo_invocation.test_stdout_is_empty", + "eval.tests.test_structable_demo_invocation.test_stdout_remains_empty_with_probe_env", + "eval.tests.test_structable_demo_invocation.test_trace_anchors_to_users_insert_site", + "eval.tests.test_structable_demo_invocation.test_version_style_argv_is_ignored", + "eval.tests.test_structable_demo_options.test_supported_option_proceeds_to_dial[PGCONNECT_TIMEOUT-5]", + "eval.tests.test_structable_demo_options.test_supported_option_proceeds_to_dial[PGLOADBALANCEHOSTS-random]", + "eval.tests.test_structable_demo_options.test_supported_option_proceeds_to_dial[PGSSLMODE-allow]", + "eval.tests.test_structable_demo_options.test_supported_option_proceeds_to_dial[PGSSLMODE-prefer]", + "eval.tests.test_structable_demo_options.test_supported_option_proceeds_to_dial[PGTARGETSESSIONATTRS-read-write]", + "eval.tests.test_structable_demo_options.test_unsupported_message_names_the_option[PGREQUIRESSL]", + "eval.tests.test_structable_demo_options.test_unsupported_message_names_the_option[PGSERVICEFILE]", + "eval.tests.test_structable_demo_options.test_unsupported_message_names_the_option[PGSERVICE]", + "eval.tests.test_structable_demo_options.test_unsupported_option_never_emits_stdout", + "eval.tests.test_structable_demo_options.test_unsupported_option_preserves_full_panic_page", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGREQUIRESSL-0]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGREQUIRESSL-1]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGREQUIRESSL-]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGREQUIRESSL-maybe]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGSERVICE-]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGSERVICE-a_b]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGSERVICE-myservice]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGSERVICEFILE-/tmp/whatever]", + "eval.tests.test_structable_demo_options.test_unsupported_option_rejected_before_dial[PGSERVICEFILE-nonexistent.path]", + "eval.tests.test_structable_demo_plus_port.test_digit_bearing_port_token_rejected[0x10-panic: dial tcp: lookup tcp/0x10: unknown port]", + "eval.tests.test_structable_demo_plus_port.test_digit_bearing_port_token_rejected[12 34-panic: dial tcp: lookup tcp/12 34: unknown port]", + "eval.tests.test_structable_demo_plus_port.test_digit_bearing_port_token_rejected[5432x-panic: dial tcp: lookup tcp/5432x: unknown port]", + "eval.tests.test_structable_demo_plus_port.test_plus_prefixed_port_normalizes[127.0.0.1-+0-panic: dial tcp 127.0.0.1:0: connect: connection refused]", + "eval.tests.test_structable_demo_plus_port.test_plus_prefixed_port_normalizes[127.0.0.1-+5432-panic: dial tcp 127.0.0.1:5432: connect: connection refused]", + "eval.tests.test_structable_demo_plus_port.test_plus_prefixed_port_normalizes[127.0.0.1-+65535-panic: dial tcp 127.0.0.1:65535: connect: connection refused]", + "eval.tests.test_structable_demo_plus_port.test_plus_sign_is_not_duplicated_or_kept_in_target", + "eval.tests.test_structable_demo_plus_port.test_rejected_token_keeps_panic_framing_and_empty_stdout", + "eval.tests.test_structable_demo_port_matrix.test_default_port_is_5432", + "eval.tests.test_structable_demo_port_matrix.test_empty_port_override_dials_zero", + "eval.tests.test_structable_demo_port_matrix.test_malformed_port_is_rejected[-1-panic: dial tcp: address -1: invalid port]", + "eval.tests.test_structable_demo_port_matrix.test_malformed_port_is_rejected[999999-panic: dial tcp: address 999999: invalid port]", + "eval.tests.test_structable_demo_port_matrix.test_malformed_port_is_rejected[abc-panic: dial tcp: lookup tcp/abc: unknown port]", + "eval.tests.test_structable_demo_port_matrix.test_malformed_port_names_the_token", + "eval.tests.test_structable_demo_port_matrix.test_overflow_port_reports_invalid_port", + "eval.tests.test_structable_demo_port_matrix.test_port_failure_preserves_panic_framing", + "eval.tests.test_structable_demo_port_matrix.test_valid_port_is_used_in_dial_target[0-panic: dial tcp [::1]:0: connect: connection refused]", + "eval.tests.test_structable_demo_port_matrix.test_valid_port_is_used_in_dial_target[0043-panic: dial tcp [::1]:43: connect: connection refused]", + "eval.tests.test_structable_demo_port_matrix.test_valid_port_is_used_in_dial_target[65535-panic: dial tcp [::1]:65535: connect: connection refused]", + "eval.tests.test_structable_demo_port_matrix.test_valid_port_is_used_in_dial_target[9999-panic: dial tcp [::1]:9999: connect: connection refused]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_normalization_preserves_panic_page[///x-5432]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_normalization_preserves_panic_page[/srv/../pg-9999]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_normalization_preserves_panic_page[/tmp//x-5432]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_socket_directory_normalization[//-5432-/.s.PGSQL.5432-panic: dial unix /.s.PGSQL.5432: connect: no such file or directory]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_socket_directory_normalization[///x-None-/x/.s.PGSQL.5432-panic: dial unix /x/.s.PGSQL.5432: connect: no such file or directory]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_socket_directory_normalization[/srv/../pg-9999-/pg/.s.PGSQL.9999-panic: dial unix /pg/.s.PGSQL.9999: connect: no such file or directory]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_socket_directory_normalization[/tmp//x-None-/tmp/x/.s.PGSQL.5432-panic: dial unix /tmp/x/.s.PGSQL.5432: connect: no such file or directory]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_socket_directory_normalization[/var/run//postgresql-6543-/var/run/postgresql/.s.PGSQL.6543-panic: dial unix /var/run/postgresql/.s.PGSQL.6543: connect: no such file or directory]", + "eval.tests.test_structable_demo_unix_path_normalization.test_unix_triple_slash_never_emits_stdout", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_default_port_is_5432", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/-9999-.s.PGSQL.9999]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/a/b/c-5432-.s.PGSQL.5432]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/custom/dir-65430-.s.PGSQL.65430]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/srv/database-0-.s.PGSQL.0]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/srv/database-00092-.s.PGSQL.00092]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/tmp-9999-.s.PGSQL.9999]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/tmp-None-.s.PGSQL.5432]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/users/matt-1234-.s.PGSQL.1234]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/var/run/postgresql-5432-.s.PGSQL.5432]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dial_target[/var/run/postgresql-5433-.s.PGSQL.5433]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_dir_with_spaces_preserved", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_empty_port_renders_empty_suffix", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_fails_fast_not_hang_under_timeout", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_never_emits_stdout", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_port_leading_zero_preserved_verbatim", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_preserves_full_panic_page[/tmp-9999-.s.PGSQL.9999]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_preserves_full_panic_page[/var/run/postgresql-5432-.s.PGSQL.5432]", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_root_directory_works", + "eval.tests.test_structable_demo_unixsocket.test_unix_socket_trailing_slash_folds_cleanly" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_bind_and_resultset.test_delete_binds_the_primary_key_id", + "eval.tests.test_bind_and_resultset.test_insert_binds_name_and_email", + "eval.tests.test_bind_and_resultset.test_insert_null_string_scan_error_at_users_59[email-2-\"email\"]", + "eval.tests.test_bind_and_resultset.test_insert_null_string_scan_error_at_users_59[name-1-\"name\"]", + "eval.tests.test_bind_and_resultset.test_insert_returning_empty_panics_no_rows_at_users_59", + "eval.tests.test_bind_and_resultset.test_load_by_name_binds_matt_as_predicate", + "eval.tests.test_bind_and_resultset.test_load_multirow_select_scans_only_first_row", + "eval.tests.test_bind_and_resultset.test_load_null_string_scan_error_at_users_69[email-2-\"email\"]", + "eval.tests.test_bind_and_resultset.test_load_null_string_scan_error_at_users_69[name-1-\"name\"]", + "eval.tests.test_bind_and_resultset.test_update_binds_email_name_and_id", + "eval.tests.test_scan_error_and_log.test_demo_issues_insert_select_update_delete_in_order", + "eval.tests.test_scan_error_and_log.test_demo_select_targets_name_placeholder", + "eval.tests.test_scan_error_and_log.test_insert_non_numeric_id_scan_error_panics_users_59[12abc]", + "eval.tests.test_scan_error_and_log.test_insert_non_numeric_id_scan_error_panics_users_59[]", + "eval.tests.test_scan_error_and_log.test_insert_non_numeric_id_scan_error_panics_users_59[hello]", + "eval.tests.test_scan_error_and_log.test_insert_non_numeric_id_scan_error_panics_users_59[not-a-number]", + "eval.tests.test_scan_error_and_log.test_insert_null_id_scan_error_panics_users_59", + "eval.tests.test_scan_error_and_log.test_insert_wrong_returning_arity_panics_users_59[cols0-types0-row0-expected 2 destination arguments in Scan, not 3]", + "eval.tests.test_scan_error_and_log.test_insert_wrong_returning_arity_panics_users_59[cols1-types1-row1-expected 4 destination arguments in Scan, not 3]", + "eval.tests.test_scan_error_and_log.test_insert_wrong_returning_arity_panics_users_59[cols2-types2-row2-expected 1 destination arguments in Scan, not 3]", + "eval.tests.test_scan_error_and_log.test_load_name_non_numeric_id_scan_error_panics_users_69[1.5]", + "eval.tests.test_scan_error_and_log.test_load_name_non_numeric_id_scan_error_panics_users_69[ff]", + "eval.tests.test_scan_error_and_log.test_load_name_non_numeric_id_scan_error_panics_users_69[x]", + "eval.tests.test_scan_error_and_log.test_load_name_null_id_scan_error_panics_users_69", + "eval.tests.test_users_demo.test_arbitrary_load_name_pairs_rendered[11-eleven@example.com]", + "eval.tests.test_users_demo.test_arbitrary_load_name_pairs_rendered[3-three@example.com]", + "eval.tests.test_users_demo.test_arbitrary_load_name_pairs_rendered[99-a@b.co]", + "eval.tests.test_users_demo.test_arbitrary_statement_error_aborts_flow[delete from users-delete rejected by server-3]", + "eval.tests.test_users_demo.test_arbitrary_statement_error_aborts_flow[update users-update rejected by server-2]", + "eval.tests.test_users_demo.test_auth_rejected_fails_before_any_insert", + "eval.tests.test_users_demo.test_auth_rejected_panics_with_password_message", + "eval.tests.test_users_demo.test_connection_refused_panics_with_dial_error", + "eval.tests.test_users_demo.test_connection_refused_prints_nothing_to_stdout", + "eval.tests.test_users_demo.test_connection_refused_reports_the_exact_port", + "eval.tests.test_users_demo.test_custom_insert_and_load_renders_both_ids", + "eval.tests.test_users_demo.test_custom_insert_returning_id", + "eval.tests.test_users_demo.test_custom_query_script_renders_exact_stdout[custom_insert_and_load.json-42-7-custom@example.org]", + "eval.tests.test_users_demo.test_custom_query_script_renders_exact_stdout[insert_returns_id_42.json-42-1-Masterminds@example.com]", + "eval.tests.test_users_demo.test_custom_query_script_renders_exact_stdout[load_name_custom_email.json-1-7-custom@example.org]", + "eval.tests.test_users_demo.test_delete_server_error_panics_at_users_81", + "eval.tests.test_users_demo.test_delete_server_error_still_prints_update_line", + "eval.tests.test_users_demo.test_full_crud_happy_path_matches_golden", + "eval.tests.test_users_demo.test_full_crud_happy_path_stdout_and_exit", + "eval.tests.test_users_demo.test_happy_path_prints_a_fresh_user_object", + "eval.tests.test_users_demo.test_insert_server_error_aborts_before_first_line", + "eval.tests.test_users_demo.test_insert_server_error_panics_at_users_59", + "eval.tests.test_users_demo.test_load_name_no_rows_panics", + "eval.tests.test_users_demo.test_unset_port_falls_back_and_is_refused", + "eval.tests.test_users_demo.test_update_server_error_omits_updated_line", + "eval.tests.test_users_demo.test_update_server_error_panics_at_users_75" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_structable_backend.test_address_is_ipv6_bracketed_well_formed", + "eval.tests.test_structable_backend.test_default_applies_postgres_default_port", + "eval.tests.test_structable_backend.test_default_dials_ipv6_loopback_on_5432", + "eval.tests.test_structable_backend.test_default_panic_points_at_users_example", + "eval.tests.test_structable_backend.test_default_reports_connection_refused", + "eval.tests.test_structable_backend.test_default_terminates_via_go_panic", + "eval.tests.test_structable_backend.test_default_writes_nothing_to_stdout", + "eval.tests.test_structable_backend.test_failure_is_deterministic_across_runs", + "eval.tests.test_structable_backend.test_panic_line_is_single_and_not_application_text", + "eval.tests.test_structable_backend.test_pghost_and_port_override_dial_both", + "eval.tests.test_structable_backend.test_pghost_changes_dial_target[empty-host]", + "eval.tests.test_structable_backend.test_pghost_changes_dial_target[ipv4-loopback]", + "eval.tests.test_structable_backend.test_pghost_changes_dial_target[ipv6-numeric]", + "eval.tests.test_structable_backend.test_pghost_changes_dial_target[localhost-alias]", + "eval.tests.test_structable_backend.test_pghost_empty_omits_host_rather_than_falling_back", + "eval.tests.test_structable_backend.test_pghost_ipv4_vs_ipv6_loopback_are_distinct", + "eval.tests.test_structable_backend.test_pghost_unknown_domains_panic_with_no_such_host", + "eval.tests.test_structable_backend.test_pgport_changes_dial_port[common-alt]", + "eval.tests.test_structable_backend.test_pgport_changes_dial_port[high-valid]", + "eval.tests.test_structable_backend.test_pgport_changes_dial_port[zero]", + "eval.tests.test_structable_backend.test_pgport_non_numeric_panics_with_unknown_port", + "eval.tests.test_structable_backend.test_port_override_survives_host_override", + "eval.tests.test_structable_backend.test_stderr_always_opens_with_panic_across_configs", + "eval.tests.test_structable_backend.test_stdout_stays_empty_across_dsn_configs", + "eval.tests.test_structable_dsn_error_classes.test_invalid_port_wins_over_host_override[invalid-port-over-host4]", + "eval.tests.test_structable_dsn_error_classes.test_invalid_port_wins_over_host_override[invalid-port-over-host6]", + "eval.tests.test_structable_dsn_error_classes.test_ipv4_mapped_ipv6_folds_to_ipv4_loopback", + "eval.tests.test_structable_dsn_error_classes.test_link_local_ipv6_without_zone_is_invalid_argument", + "eval.tests.test_structable_dsn_error_classes.test_max_valid_port_is_65535", + "eval.tests.test_structable_dsn_error_classes.test_network_unreachable_host_keeps_composed_port", + "eval.tests.test_structable_dsn_error_classes.test_new_error_classes_always_write_stdout_to_nothing", + "eval.tests.test_structable_dsn_error_classes.test_new_error_classes_are_deterministic_across_runs", + "eval.tests.test_structable_dsn_error_classes.test_non_routable_hosts_are_network_unreachable[broadcast]", + "eval.tests.test_structable_dsn_error_classes.test_non_routable_hosts_are_network_unreachable[link-local-with-zone]", + "eval.tests.test_structable_dsn_error_classes.test_non_routable_hosts_are_network_unreachable[multicast]", + "eval.tests.test_structable_dsn_error_classes.test_out_of_range_port_is_invalid_port[65536]", + "eval.tests.test_structable_dsn_error_classes.test_out_of_range_port_is_invalid_port[70000]", + "eval.tests.test_structable_dsn_error_classes.test_out_of_range_port_is_invalid_port[huge]", + "eval.tests.test_structable_dsn_error_classes.test_out_of_range_port_is_invalid_port[negative-one]", + "eval.tests.test_structable_dsn_error_classes.test_plus_and_leading_space_port_trim_to_5432[leading-space]", + "eval.tests.test_structable_dsn_error_classes.test_plus_and_leading_space_port_trim_to_5432[plus-prefix]", + "eval.tests.test_structable_dsn_error_classes.test_port_service_lookup_precedes_host_dns_resolution", + "eval.tests.test_structable_dsn_error_classes.test_port_strings_that_collapse_to_zero_dial_port_zero[leading-zeros-zero]", + "eval.tests.test_structable_dsn_error_classes.test_port_strings_that_collapse_to_zero_dial_port_zero[minus-zero]", + "eval.tests.test_structable_dsn_error_classes.test_ports_with_non_numeric_suffix_fall_to_service_lookup[hex-literal]", + "eval.tests.test_structable_dsn_error_classes.test_ports_with_non_numeric_suffix_fall_to_service_lookup[trailing-space]", + "eval.tests.test_structable_dsn_error_classes.test_syntactically_invalid_hosts_fall_back_to_dns[dangling-dot-ipv4]", + "eval.tests.test_structable_dsn_error_classes.test_syntactically_invalid_hosts_fall_back_to_dns[leading-space-name]", + "eval.tests.test_structable_dsn_error_classes.test_syntactically_invalid_hosts_fall_back_to_dns[out-of-range-octets]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[channel-binding]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[client-auth-mode]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[connect-timeout]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[gss-hostname]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[gssenc-mode]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[socket-dir]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[ssl-min-protocol]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[ssl-negotiation]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[toptions]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[tsa-bogus]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[tsa-prefer-standby]", + "eval.tests.test_structable_parseopts_config_classes.test_additional_pass_through_keys_still_reach_dial[tsa-read-only]", + "eval.tests.test_structable_parseopts_config_classes.test_config_error_classes_are_deterministic_across_runs", + "eval.tests.test_structable_parseopts_config_classes.test_config_error_classes_never_leak_stdout", + "eval.tests.test_structable_parseopts_config_classes.test_empty_value_only_pgdatestyle_is_treated_as_unset", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgkrbsrvname-empty]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgkrbsrvname-named]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgkrbsrvname-postgres]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgrequiressl-0]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgrequiressl-1]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgrequiressl-empty]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgrequiressl-true]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgsslcrl-abs]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_not_supported_keys_are_rejected[pgsslcrl-empty]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejection_classes_never_leak_stdout", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejection_precedence_is_deterministic_across_runs", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_are_fatal_before_any_dial_connect", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[krb-vs-datestyle]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[krb-vs-requiressl]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[krb-vs-service]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[krb-vs-servicefile]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[krb-vs-sslcrl]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[requiressl-vs-datestyle]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[requiressl-vs-service]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[sslcrl-vs-datestyle]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[sslcrl-vs-requiressl]", + "eval.tests.test_structable_parseopts_config_classes.test_extra_rejections_beat_previously_covered_rejections[sslcrl-vs-service]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[appname]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[database]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[encoding]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[options]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[password]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[sslkey]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[sslmode]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[sslrootcert]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[tz]", + "eval.tests.test_structable_parseopts_config_classes.test_pass_through_option_keys_still_reach_dial[user]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[british-dmy]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[german]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[iso-nospace]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[iso-space-dmy]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[iso-underscore]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[postgres]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_invalid_value_is_rejected[sql]", + "eval.tests.test_structable_parseopts_config_classes.test_pgdatestyle_valid_value_is_accepted_and_dials", + "eval.tests.test_structable_parseopts_config_classes.test_pgservice_set_is_rejected[dash-led]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservice_set_is_rejected[dashed]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservice_set_is_rejected[named-postgres]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservice_set_is_rejected[plain]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservice_wins_over_other_config_when_both_set", + "eval.tests.test_structable_parseopts_config_classes.test_pgservicefile_set_is_rejected[abs-nonexistent]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservicefile_set_is_rejected[bare-name]", + "eval.tests.test_structable_parseopts_config_classes.test_pgservicefile_set_is_rejected[tilde-path]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[full-chain-krbsrvname]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[no-krbsrvname-servicefile]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[no-service-sslcrl]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[no-servicefile-service]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[no-sslcrl-requiressl]", + "eval.tests.test_structable_parseopts_config_classes.test_rejecting_keys_validate_in_fixed_precedence_order[only-datestyle]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_ipv4_mapped_broadcast_folds_and_is_unreachable", + "eval.tests.test_structable_service_and_wildcard_resolution.test_ipv4_mapped_non_loopback_folds_to_its_ipv4_peer", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[domain]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[ftp-data]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[ftp]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[git]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[http]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[https]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[ldap]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[mysql]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[redis]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[smtp]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[ssh]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_known_service_names_resolve_to_their_ports[www-alias]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_and_numeric_port_both_resolve_to_5432[numeric-5432]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_and_numeric_port_both_resolve_to_5432[postgres-service]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_and_numeric_port_both_resolve_to_5432[postgresql-alias]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_and_wildcard_classes_never_leak_stdout", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_name_lookup_is_case_insensitive[mixed-case]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_name_lookup_is_case_insensitive[upper-http]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_name_lookup_is_case_insensitive[upper-postgres]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_name_lookup_is_case_insensitive[upper-ssh]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_name_resolution_is_deterministic_across_runs", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_port_resolves_and_composes_with_host[host4-postgres]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_port_resolves_and_composes_with_host[host4-ssh]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_port_resolves_and_composes_with_host[host6-http]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_service_port_resolves_and_composes_with_host[host6-https]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_unspecified_address_is_dialed_as_is[ipv4-unspecified]", + "eval.tests.test_structable_service_and_wildcard_resolution.test_unspecified_address_is_dialed_as_is[ipv6-unspecified]" + ] + } + }, + "commit": "a1a302ef78ec3d85606dcf104a9a168542004036", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.0965624383741357, + "eval_clean_hashes": [ + "0e80039426e40897d286d0cbaccc1445b60e8fc6e3f0c5dbbc79445674277829" + ], + "input_record": { + "commit": "a1a302ef78ec3d85606dcf104a9a168542004036", + "commits": 67, + "contributors": 4, + "difficulty": "easy", + "difficulty_code_lines": 1249, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1249, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.0965624383741357, + "difficulty_test_code_lines": 1032, + "full_name": "Masterminds/structable", + "github_stars": 317, + "input_joern_zip": "go_joern/Masterminds__structable.zip", + "joern_status": true, + "joern_time": 2.205367143964395, + "language": "go", + "pb_match": [ + { + "pb_fullname": "sclevine/yj", + "rank": 781, + "similarity": 0.47951656579971313 + }, + { + "pb_fullname": "mfridman/tparse", + "rank": 650, + "similarity": 0.5146654844284058 + }, + { + "pb_fullname": "skeema/skeema", + "rank": 388, + "similarity": 0.5195891261100769 + }, + { + "pb_fullname": "noborus/trdsql", + "rank": 958, + "similarity": 0.4753149151802063 + }, + { + "pb_fullname": "psampaz/go-mod-outdated", + "rank": 424, + "similarity": 0.4891971945762634 + } + ], + "repo_age": 12.45, + "repo_path": "go/Masterminds__structable", + "source": "commit:a1a302ef78ec3d85606dcf104a9a168542004036", + "status": "done", + "url": "https://github.com/Masterminds/structable" + }, + "instance_id": "Masterminds__structable.a1a302e", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "Masterminds/structable" +} diff --git a/masterminds--structable.a1a302e/tests/test.sh b/masterminds--structable.a1a302e/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/masterminds--structable.a1a302e/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/masterminds--structable.a1a302e/tests/workspace.tar.gz b/masterminds--structable.a1a302e/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b18124a306f8b7f47e52e932f62d67be1cb8cef7 --- /dev/null +++ b/masterminds--structable.a1a302e/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:924decbf27be051c8b1f1f990f76cef4124aecfa0d37d97eca795ac0178f9c90 +size 4987 diff --git a/math-fehr--fast-wfc.0edfccf/environment/Dockerfile b/math-fehr--fast-wfc.0edfccf/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..edce77c9eff98ecfdd18ea41d0dd516062fb88d9 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/environment/Dockerfile @@ -0,0 +1,55 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/math-fehr--fast-wfc.0edfccf/environment/download.sh b/math-fehr--fast-wfc.0edfccf/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..88ab92c0d7309bc14e0b61693f25abcf9547225a --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/environment/download.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download/prefetch stage for fast-wfc. +# +# fast-wfc builds fully from in-tree sources: +# * the fastwfc library sources live under src/, +# * the wfc_demo example vendors all its third-party headers +# (stb_image.h, stb_image_write.h, rapidxml.hpp, rapidxml_utils.hpp) under +# example/src/include/external/, +# * the runtime sample data is bundled under example/samples.xml and +# example/samples/. +# +# The base build image (Ubuntu 22.04) already supplies the complete required +# toolchain — gcc/g++ 13.3.0, cmake 3.31, make 4.3, pkg-config — so nothing +# needs to be installed, downloaded, or prefetched for this project, and no +# apt packages are required at build time (build.sh links libstdc++ and +# libgcc statically). +# +# This file is sourced via `source /source_ro/download.sh` from the repository +# root in a read-only mount and must remain valid in shell source mode. It +# therefore performs no compile, link, or test step and makes no changes to +# the tree. It depends on no pre-existing repository file: every dependency is +# in-tree and the toolchain is in PATH. +# +# Nothing is downloaded here; the build stage runs with build.sh. + +# Export the toolchain so build.sh is explicit about its environment. +# `command -v` writes to the captured variable, not to the terminal. +GCC_BIN="$(command -v gcc)" +if [ -n "$GCC_BIN" ]; then + export CC="$GCC_BIN" +else + echo "download.sh: gcc not found in PATH" >&2 +fi + +GXX_BIN="$(command -v g++)" +if [ -n "$GXX_BIN" ]; then + export CXX="$GXX_BIN" +else + echo "download.sh: g++ not found in PATH" >&2 +fi + +CMAKE_BIN="$(command -v cmake)" +if [ -n "$CMAKE_BIN" ]; then + export CMAKE="$CMAKE_BIN" +else + echo "download.sh: cmake not found in PATH" >&2 +fi + +echo "fast-wfc: no external dependencies to fetch; toolchain and third-party headers are in-tree." diff --git a/math-fehr--fast-wfc.0edfccf/environment/executable b/math-fehr--fast-wfc.0edfccf/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..081578fc1991817093854771ab2864029764f387 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ec0909054ca5e543fee6b65b58f5ed4d580585cac7cb87e3c4046b426268df1 +size 3016128 diff --git a/math-fehr--fast-wfc.0edfccf/environment/harbor_prepare_download_env.sh b/math-fehr--fast-wfc.0edfccf/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/math-fehr--fast-wfc.0edfccf/environment/workspace.tar.gz b/math-fehr--fast-wfc.0edfccf/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..94a84bfa181970d67a05cba4d522d05279fde418 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:941acf3123101500e8ed80b56cc3f05f8cc3fc8e679f02626098a801f414b023 +size 238171 diff --git a/math-fehr--fast-wfc.0edfccf/instruction.md b/math-fehr--fast-wfc.0edfccf/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/math-fehr--fast-wfc.0edfccf/solution/solve.sh b/math-fehr--fast-wfc.0edfccf/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/math-fehr--fast-wfc.0edfccf/task.toml b/math-fehr--fast-wfc.0edfccf/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..80a327f4a08267df156c33c5a0c41a52c9ad2691 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/math-fehr--fast-wfc.0edfccf" +description = "Synthetic ProgramGym cleanroom reconstruction task for math-fehr/fast-wfc" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "math-fehr__fast-wfc.0edfccf" +repository = "math-fehr/fast-wfc" +commit = "0edfccf8f354da79b00ebfea7b1dbee5271e9c1f" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.2027606873931997 +test_branches = 4 +test_count = 333 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/math-fehr--fast-wfc.0edfccf/tests/Dockerfile b/math-fehr--fast-wfc.0edfccf/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..76cacca3a4006591209a34f93e00d4142b6fe407 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/Dockerfile @@ -0,0 +1,63 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_01.tar.gz b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2b9db65fc9cf8f4d0273395bec6f9142ca370a9b --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:255fef5f8f4e9d7c8c9d302fa4474a4a30f33c73e48ad9181cac86d85110355f +size 29633 diff --git a/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_02.tar.gz b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b800c8d21bc4ae87677025084fce28ffbf677214 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bafc1650502bff3d16d3e239392c4eb1b14f0e8b4e4d819a5ef87cc40d36e52e +size 16414 diff --git a/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_03.tar.gz b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..96f3eaebc23091d27b731bdc922f878533a3584d --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f1e38af434b65abdd98a9b21759bf4cf92edd52279fe099b717d9f98339c88 +size 26034 diff --git a/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_04.tar.gz b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8e435eeb1f67878f87a9dd6aac7bad57ced3ad45 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee005a16996f6befa52cdd3a2cfcc69941dcb89039fc38137653b8205097864c +size 247741 diff --git a/math-fehr--fast-wfc.0edfccf/tests/download.sh b/math-fehr--fast-wfc.0edfccf/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..88ab92c0d7309bc14e0b61693f25abcf9547225a --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/download.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym download/prefetch stage for fast-wfc. +# +# fast-wfc builds fully from in-tree sources: +# * the fastwfc library sources live under src/, +# * the wfc_demo example vendors all its third-party headers +# (stb_image.h, stb_image_write.h, rapidxml.hpp, rapidxml_utils.hpp) under +# example/src/include/external/, +# * the runtime sample data is bundled under example/samples.xml and +# example/samples/. +# +# The base build image (Ubuntu 22.04) already supplies the complete required +# toolchain — gcc/g++ 13.3.0, cmake 3.31, make 4.3, pkg-config — so nothing +# needs to be installed, downloaded, or prefetched for this project, and no +# apt packages are required at build time (build.sh links libstdc++ and +# libgcc statically). +# +# This file is sourced via `source /source_ro/download.sh` from the repository +# root in a read-only mount and must remain valid in shell source mode. It +# therefore performs no compile, link, or test step and makes no changes to +# the tree. It depends on no pre-existing repository file: every dependency is +# in-tree and the toolchain is in PATH. +# +# Nothing is downloaded here; the build stage runs with build.sh. + +# Export the toolchain so build.sh is explicit about its environment. +# `command -v` writes to the captured variable, not to the terminal. +GCC_BIN="$(command -v gcc)" +if [ -n "$GCC_BIN" ]; then + export CC="$GCC_BIN" +else + echo "download.sh: gcc not found in PATH" >&2 +fi + +GXX_BIN="$(command -v g++)" +if [ -n "$GXX_BIN" ]; then + export CXX="$GXX_BIN" +else + echo "download.sh: g++ not found in PATH" >&2 +fi + +CMAKE_BIN="$(command -v cmake)" +if [ -n "$CMAKE_BIN" ]; then + export CMAKE="$CMAKE_BIN" +else + echo "download.sh: cmake not found in PATH" >&2 +fi + +echo "fast-wfc: no external dependencies to fetch; toolchain and third-party headers are in-tree." diff --git a/math-fehr--fast-wfc.0edfccf/tests/executable b/math-fehr--fast-wfc.0edfccf/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..081578fc1991817093854771ab2864029764f387 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ec0909054ca5e543fee6b65b58f5ed4d580585cac7cb87e3c4046b426268df1 +size 3016128 diff --git a/math-fehr--fast-wfc.0edfccf/tests/harbor_prepare_download_env.sh b/math-fehr--fast-wfc.0edfccf/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/math-fehr--fast-wfc.0edfccf/tests/programgym_evaluator.py b/math-fehr--fast-wfc.0edfccf/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/math-fehr--fast-wfc.0edfccf/tests/programgym_task.json b/math-fehr--fast-wfc.0edfccf/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..8253cd510d497be478c22f6f7c52c5c51da03a4b --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/programgym_task.json @@ -0,0 +1,984 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_core_geometry_edges.test_directed_cycle_tiling_on_open_border", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_core_geometry_edges.test_multitile_nontoric_tiling_alternation_on_open_border", + "reasons": [ + { + "id": "if_no_else", + "message": "pytest test has a conditional assertion with no else branch", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Add an else branch that fails, or assert the condition before making conditional checks.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_core_geometry_edges.test_nontoric_overlapping_odd_dimension_multipattern", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_core_geometry_edges.test_overlapping_n_equal_full_source_dimension", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_core_geometry_edges.test_overlapping_periodic_input_false_toric_rectangular", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_core_geometry_edges.test_tiling_tile_larger_than_single_cell_board", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_core_geometry_edges.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_determinism.test_ground_locked_contradiction_always_fails", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_determinism.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_empty_samples_xml_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_missing_config_does_not_write_results", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_missing_samples_xml_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_non_xml_samples_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_screenshots_zero_overlapping_runs_no_instance", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_truncated_element_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_unknown_overlapping_and_simpletiled_nodes_are_ignored", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_valid_config_missing_simpletiled_data_dir_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_valid_root_with_missing_overlapping_image_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_valid_root_with_no_samples_children_exits_zero", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_io_config.test_whitespace_only_samples_xml_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_io_config.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_deep.test_overlapping_n4_pattern_size_fills_large_output", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_deep.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_deep.test_satisfiable_periodic_input_false_rectangular_shape", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_deep.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_deep.test_subset_filters_multi_tile_set_to_selected_tiles", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_deep.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_minimal_tiling_node_uses_config_defaults", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_multi_orientation_nontoric_open_border", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_overlapping_minimal_node_uses_config_defaults", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_tiling_tile_image_wrong_size_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_unknown_subset_uses_full_tile_set", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_weighted_free_equal_weights_balance_two_colours", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_propagator_expansion.test_weighted_free_heavy_skew_concentrates_choice", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_propagator_expansion.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_ground_large_pattern_unsat_contradicts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_mixed_overlapping_and_simpletiled_instances", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_multiple_screenshots_of_multi_pattern_instance", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_nonperiodic_output_asymmetric_multi_pattern", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_simpletiled_ignores_screenshots_attribute", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_solver_boundaries.test_summer_pregridding_unsat_contradicts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_solver_boundaries.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_success_protocol.test_empty_instances_leave_only_summary", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_success_protocol.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_success_protocol.test_overlapping_success_protocol", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_success_protocol.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_constraint_propagation.test_checkerboard_parity_flips_between_adjoining_cells", + "eval.tests.test_constraint_propagation.test_checkerboard_result_dimensions_scale_by_tile_size", + "eval.tests.test_constraint_propagation.test_checkerboard_uses_only_the_two_configured_colours", + "eval.tests.test_constraint_propagation.test_nonperiodic_checkerboard_no_border_break[0]", + "eval.tests.test_constraint_propagation.test_nonperiodic_checkerboard_no_border_break[1]", + "eval.tests.test_constraint_propagation.test_nonperiodic_checkerboard_no_border_break[2]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims0]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims1]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims2]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims3]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims4]", + "eval.tests.test_constraint_propagation.test_odd_dimension_periodic_board_always_contradicts[dims5]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims0-0]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims0-1]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims0-2]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims1-0]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims1-1]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims1-2]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims2-0]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims2-1]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims2-2]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims3-0]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims3-1]", + "eval.tests.test_constraint_propagation.test_periodic_checkerboard_never_has_adjacent_same_colour[dims3-2]", + "eval.tests.test_core_geometry_edges.test_directed_cycle_tiling_on_open_border", + "eval.tests.test_core_geometry_edges.test_multitile_nontoric_tiling_alternation_on_open_border", + "eval.tests.test_core_geometry_edges.test_nontoric_overlapping_odd_dimension_multipattern", + "eval.tests.test_core_geometry_edges.test_overlapping_n_equal_full_source_dimension", + "eval.tests.test_core_geometry_edges.test_overlapping_periodic_input_false_toric_rectangular", + "eval.tests.test_core_geometry_edges.test_tiling_tile_larger_than_single_cell_board", + "eval.tests.test_determinism.TestSolidOverlappingStable.test_result_bytes_stable_across_runs[0]", + "eval.tests.test_determinism.TestSolidOverlappingStable.test_result_bytes_stable_across_runs[1]", + "eval.tests.test_determinism.TestSolidOverlappingStable.test_result_bytes_stable_across_runs[2]", + "eval.tests.test_determinism.TestSolidOverlappingStable.test_stable_across_independent_sandboxes", + "eval.tests.test_determinism.test_ground_locked_contradiction_always_fails", + "eval.tests.test_determinism.test_repeated_ground_fail_does_not_leak_results", + "eval.tests.test_determinism.test_single_tile_3x3_board_image_stable", + "eval.tests.test_determinism.test_single_tile_board_is_fully_filled_with_tile_colour", + "eval.tests.test_determinism.test_solid_overlap_entire_output_single_source_colour", + "eval.tests.test_ground_boundaries.TestGroundLocking.test_ground_bottom_row_stable_across_runs", + "eval.tests.test_ground_boundaries.TestGroundLocking.test_ground_sets_bottom_row_to_ground_pattern", + "eval.tests.test_ground_boundaries.TestPatternSizeBoundary.test_pattern_size_one_preserves_output_dims", + "eval.tests.test_ground_boundaries.TestPatternSizeBoundary.test_pattern_size_three_nonperiodic_preserves_out_dims", + "eval.tests.test_ground_boundaries.TestRetryLoop.test_eventually_succeeds_and_writes_one_image", + "eval.tests.test_ground_boundaries.TestRetryLoop.test_retries_precede_terminal_success_every_run", + "eval.tests.test_io_config.test_empty_samples_xml_aborts", + "eval.tests.test_io_config.test_missing_config_does_not_write_results", + "eval.tests.test_io_config.test_missing_samples_xml_aborts", + "eval.tests.test_io_config.test_mixed_unknown_and_known_nodes_ignore_unknown", + "eval.tests.test_io_config.test_non_xml_samples_aborts", + "eval.tests.test_io_config.test_screenshots_zero_overlapping_runs_no_instance", + "eval.tests.test_io_config.test_truncated_element_aborts", + "eval.tests.test_io_config.test_unknown_overlapping_and_simpletiled_nodes_are_ignored", + "eval.tests.test_io_config.test_valid_config_missing_simpletiled_data_dir_aborts", + "eval.tests.test_io_config.test_valid_root_with_missing_overlapping_image_aborts", + "eval.tests.test_io_config.test_valid_root_with_no_samples_children_exits_zero", + "eval.tests.test_io_config.test_whitespace_only_samples_xml_aborts", + "eval.tests.test_observe_propagate_core.TestGroundCore.test_ground_with_different_pattern_size_locks_bottom_row", + "eval.tests.test_observe_propagate_core.TestOverlappingObserve.test_asymmetric_image_uses_both_source_colours[dims0]", + "eval.tests.test_observe_propagate_core.TestOverlappingObserve.test_asymmetric_image_uses_both_source_colours[dims1]", + "eval.tests.test_observe_propagate_core.TestOverlappingObserve.test_asymmetric_image_uses_both_source_colours[dims2]", + "eval.tests.test_observe_propagate_core.TestOverlappingObserve.test_asymmetric_image_uses_both_source_colours[dims3]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[I]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[L]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[P]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[T]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[X]", + "eval.tests.test_observe_propagate_core.TestTilingSymmetry.test_single_tile_all_symmetries_fill_board[\\\\]", + "eval.tests.test_observe_propagate_core.test_checker_overlap_large_multi_pattern_output", + "eval.tests.test_observe_propagate_core.test_invalid_tiling_symmetry_aborts", + "eval.tests.test_observe_propagate_core.test_nonperiodic_input_contradicts_deterministically[1]", + "eval.tests.test_observe_propagate_core.test_nonperiodic_input_contradicts_deterministically[2]", + "eval.tests.test_observe_propagate_core.test_nonperiodic_input_contradicts_deterministically[4]", + "eval.tests.test_observe_propagate_core.test_nonperiodic_input_contradicts_deterministically[8]", + "eval.tests.test_observe_propagate_core.test_overlapping_pattern_size_extraction_sizes_wave", + "eval.tests.test_observe_propagate_core.test_overlapping_symmetry_value_determines_pattern_set[1]", + "eval.tests.test_observe_propagate_core.test_overlapping_symmetry_value_determines_pattern_set[2]", + "eval.tests.test_observe_propagate_core.test_overlapping_symmetry_value_determines_pattern_set[4]", + "eval.tests.test_observe_propagate_core.test_overlapping_symmetry_value_determines_pattern_set[8]", + "eval.tests.test_observe_propagate_core.test_weighted_tile_distribution_still_respects_constraints[0.001-1000.0]", + "eval.tests.test_observe_propagate_core.test_weighted_tile_distribution_still_respects_constraints[10.0-10.0]", + "eval.tests.test_observe_propagate_core.test_weighted_tile_distribution_still_respects_constraints[1000.0-0.001]", + "eval.tests.test_propagator_deep.test_directed_3cycle_tiling_forces_valid_3_colouring", + "eval.tests.test_propagator_deep.test_oriented_neighbour_edges_still_enforce_checkerboard", + "eval.tests.test_propagator_deep.test_overlapping_n4_pattern_size_fills_large_output", + "eval.tests.test_propagator_deep.test_satisfiable_periodic_input_false_keeps_all_source_colours", + "eval.tests.test_propagator_deep.test_satisfiable_periodic_input_false_rectangular_shape", + "eval.tests.test_propagator_deep.test_subset_filters_multi_tile_set_to_selected_tiles", + "eval.tests.test_propagator_expansion.test_minimal_tiling_node_uses_config_defaults", + "eval.tests.test_propagator_expansion.test_multi_orientation_loader_uses_per_orientation_images[I-2]", + "eval.tests.test_propagator_expansion.test_multi_orientation_loader_uses_per_orientation_images[L-4]", + "eval.tests.test_propagator_expansion.test_multi_orientation_loader_uses_per_orientation_images[P-8]", + "eval.tests.test_propagator_expansion.test_multi_orientation_loader_uses_per_orientation_images[T-4]", + "eval.tests.test_propagator_expansion.test_multi_orientation_loader_uses_per_orientation_images[\\\\-2]", + "eval.tests.test_propagator_expansion.test_multi_orientation_nontoric_open_border", + "eval.tests.test_propagator_expansion.test_overlapping_minimal_node_uses_config_defaults", + "eval.tests.test_propagator_expansion.test_tiling_tile_image_wrong_size_aborts", + "eval.tests.test_propagator_expansion.test_unknown_subset_uses_full_tile_set", + "eval.tests.test_propagator_expansion.test_weighted_free_equal_weights_balance_two_colours", + "eval.tests.test_propagator_expansion.test_weighted_free_heavy_skew_concentrates_choice", + "eval.tests.test_solver_boundaries.test_ground_large_pattern_unsat_contradicts", + "eval.tests.test_solver_boundaries.test_mixed_overlapping_and_simpletiled_instances", + "eval.tests.test_solver_boundaries.test_multiple_screenshots_of_multi_pattern_instance", + "eval.tests.test_solver_boundaries.test_nonperiodic_output_asymmetric_multi_pattern", + "eval.tests.test_solver_boundaries.test_nonperiodic_output_solid_large_pattern", + "eval.tests.test_solver_boundaries.test_nonperiodic_output_tiling_single_tile", + "eval.tests.test_solver_boundaries.test_simpletiled_ignores_screenshots_attribute", + "eval.tests.test_solver_boundaries.test_summer_pregridding_locks_water_border[False]", + "eval.tests.test_solver_boundaries.test_summer_pregridding_locks_water_border[True]", + "eval.tests.test_solver_boundaries.test_summer_pregridding_unsat_contradicts", + "eval.tests.test_solver_boundaries.test_wide_multiple_instances_distinct_names", + "eval.tests.test_success_protocol.test_empty_instances_leave_only_summary", + "eval.tests.test_success_protocol.test_multi_instance_ordering_protocol", + "eval.tests.test_success_protocol.test_overlapping_multiple_screenshots_naming", + "eval.tests.test_success_protocol.test_overlapping_nonperiodic_output_dimensions", + "eval.tests.test_success_protocol.test_overlapping_result_dimensions_match_config", + "eval.tests.test_success_protocol.test_overlapping_success_protocol", + "eval.tests.test_success_protocol.test_simpletiled_output_dimensions_3x3_tile", + "eval.tests.test_success_protocol.test_simpletiled_output_dimensions_pixel_tiling", + "eval.tests.test_success_protocol.test_simpletiled_subset_naming", + "eval.tests.test_success_protocol.test_simpletiled_success_protocol_and_naming" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_overlapping_wfc_additional.test_default_screenshots_writes_two_result_files", + "eval.tests.test_overlapping_wfc_additional.test_ground_zero_disables_ground_on_solid_input", + "eval.tests.test_overlapping_wfc_additional.test_multi_pattern_large_symmetry_completes_at_requested_size", + "eval.tests.test_overlapping_wfc_additional.test_non_numeric_periodic_input_treated_as_false", + "eval.tests.test_overlapping_wfc_additional.test_nonperiodic_output_width_equal_pattern_is_single_column_wave", + "eval.tests.test_overlapping_wfc_additional.test_nonperiodic_wave_single_cell_over_quad_input", + "eval.tests.test_overlapping_wfc_additional.test_nonperiodic_wave_single_row_over_solid_input", + "eval.tests.test_overlapping_wfc_additional.test_periodic_output_1x1_solid_reconstructs_single_pixel", + "eval.tests.test_overlapping_wfc_additional.test_screenshots_zero_runs_only_started_line", + "eval.tests.test_overlapping_wfc_additional.test_unknown_xml_attribute_is_ignored_and_defaults_apply", + "eval.tests.test_overlapping_wfc_basic.test_bottom_right_reconstruction_block_nonperiodic", + "eval.tests.test_overlapping_wfc_basic.test_default_output_size_is_48x48", + "eval.tests.test_overlapping_wfc_basic.test_empty_samples_document_prints_only_summary", + "eval.tests.test_overlapping_wfc_basic.test_multiple_overlapping_nodes_process_sequentially", + "eval.tests.test_overlapping_wfc_basic.test_pattern_size_variants_produce_requested_dimensions[1]", + "eval.tests.test_overlapping_wfc_basic.test_pattern_size_variants_produce_requested_dimensions[2]", + "eval.tests.test_overlapping_wfc_basic.test_pattern_size_variants_produce_requested_dimensions[3]", + "eval.tests.test_overlapping_wfc_basic.test_pattern_size_variants_produce_requested_dimensions[4]", + "eval.tests.test_overlapping_wfc_basic.test_screenshots_attribute_sets_result_file_count", + "eval.tests.test_overlapping_wfc_basic.test_screenshots_one_produces_single_file", + "eval.tests.test_overlapping_wfc_basic.test_single_finished_exact_stdout[-image1-7-5]", + "eval.tests.test_overlapping_wfc_basic.test_single_finished_exact_stdout[-image0-4-4]", + "eval.tests.test_overlapping_wfc_basic.test_underscore_sample_name_round_trips_files", + "eval.tests.test_overlapping_wfc_basic.test_uniform_input_reconstructs_solid_color[color0-5-7]", + "eval.tests.test_overlapping_wfc_basic.test_uniform_input_reconstructs_solid_color[color1-9-13]", + "eval.tests.test_overlapping_wfc_basic.test_wave_size_dims_equal_pattern[False-2-2]", + "eval.tests.test_overlapping_wfc_basic.test_wave_size_dims_equal_pattern[True-2-2]", + "eval.tests.test_overlapping_wfc_content.test_multi_pattern_output_pixels_stay_in_input_palette[image0-palette0-False-8-8]", + "eval.tests.test_overlapping_wfc_content.test_multi_pattern_output_pixels_stay_in_input_palette[image1-palette1-False-6-6]", + "eval.tests.test_overlapping_wfc_content.test_multi_pattern_output_pixels_stay_in_input_palette[image2-palette2-True-8-8]", + "eval.tests.test_overlapping_wfc_content.test_multi_pattern_output_pixels_stay_in_input_palette[image3-palette3-False-10-8]", + "eval.tests.test_overlapping_wfc_content.test_pattern_size_one_multi_pattern_input", + "eval.tests.test_overlapping_wfc_content.test_screenshots_four_writes_four_named_files", + "eval.tests.test_overlapping_wfc_content.test_tall_nonperiodic_multi_pattern_wave_palette", + "eval.tests.test_overlapping_wfc_content.test_three_node_sequential_dispatch", + "eval.tests.test_overlapping_wfc_coverage.test_ground_on_checkerboard_fails_deterministically", + "eval.tests.test_overlapping_wfc_coverage.test_large_nonperiodic_solid_output_pixels", + "eval.tests.test_overlapping_wfc_coverage.test_mixed_success_then_ground_periodic_failure", + "eval.tests.test_overlapping_wfc_coverage.test_other_json_truthy_ground_values_on_quadrant[ground=\"2\"]", + "eval.tests.test_overlapping_wfc_coverage.test_other_json_truthy_ground_values_on_quadrant[ground=\"3\"]", + "eval.tests.test_overlapping_wfc_coverage.test_periodic_wide_short_solid_output", + "eval.tests.test_overlapping_wfc_coverage.test_symmetry_one_single_pattern_output", + "eval.tests.test_overlapping_wfc_errors.test_missing_input_image_aborts_with_error_message", + "eval.tests.test_overlapping_wfc_errors.test_missing_samples_xml_aborts", + "eval.tests.test_overlapping_wfc_errors.test_non_numeric_numeric_attribute_stoi_aborts[ground=\"abc\"]", + "eval.tests.test_overlapping_wfc_errors.test_non_numeric_numeric_attribute_stoi_aborts[height=\"yy\"]", + "eval.tests.test_overlapping_wfc_errors.test_non_numeric_numeric_attribute_stoi_aborts[screenshots=\"xyz\"]", + "eval.tests.test_overlapping_wfc_errors.test_non_numeric_numeric_attribute_stoi_aborts[width=\"xx\"]", + "eval.tests.test_overlapping_wfc_errors.test_non_numeric_pattern_size_stoi_aborts", + "eval.tests.test_overlapping_wfc_errors.test_nonperiodic_output_smaller_than_pattern_aborts[1-1-2]", + "eval.tests.test_overlapping_wfc_errors.test_nonperiodic_output_smaller_than_pattern_aborts[1-8-2]", + "eval.tests.test_overlapping_wfc_errors.test_nonperiodic_output_smaller_than_pattern_aborts[2-3-3]", + "eval.tests.test_overlapping_wfc_errors.test_nonperiodic_output_smaller_than_pattern_aborts[6-3-4]", + "eval.tests.test_overlapping_wfc_errors.test_nonperiodic_output_smaller_than_pattern_aborts[8-1-2]", + "eval.tests.test_overlapping_wfc_errors.test_periodic_output_small_mask_wave_fails_not_crashes", + "eval.tests.test_overlapping_wfc_errors.test_symmetry_zero_aborts_on_empty_pattern_set", + "eval.tests.test_overlapping_wfc_errors.test_truncated_png_header_aborts", + "eval.tests.test_overlapping_wfc_errors.test_unreadable_input_image_aborts", + "eval.tests.test_overlapping_wfc_ground_pin.test_ground_bottom_row_pinned_across_full_wide_width", + "eval.tests.test_overlapping_wfc_ground_pin.test_ground_pins_bottom_row_even_when_other_waves_vary", + "eval.tests.test_overlapping_wfc_ground_pin.test_ground_pins_exact_bottom_wave_row[2-6-7]", + "eval.tests.test_overlapping_wfc_ground_pin.test_ground_pins_exact_bottom_wave_row[3-6-8]", + "eval.tests.test_overlapping_wfc_options.test_default_symmetry_is_8", + "eval.tests.test_overlapping_wfc_options.test_ground_attribute_nonperiodic_completes_run[]", + "eval.tests.test_overlapping_wfc_options.test_ground_attribute_nonperiodic_completes_run[ground=\"-1\"]", + "eval.tests.test_overlapping_wfc_options.test_ground_attribute_nonperiodic_completes_run[ground=\"0\"]", + "eval.tests.test_overlapping_wfc_options.test_ground_attribute_nonperiodic_completes_run[ground=\"1\"]", + "eval.tests.test_overlapping_wfc_options.test_ground_on_single_pattern_input_fails_deterministically", + "eval.tests.test_overlapping_wfc_options.test_ground_periodic_output_retries_per_screenshot", + "eval.tests.test_overlapping_wfc_options.test_ground_with_periodic_output_fails_branch", + "eval.tests.test_overlapping_wfc_options.test_large_output_dimensions", + "eval.tests.test_overlapping_wfc_options.test_minimal_output_nonperiodic_one_pixel", + "eval.tests.test_overlapping_wfc_options.test_non_square_output_nonperiodic_dimensions", + "eval.tests.test_overlapping_wfc_options.test_pattern_size_larger_than_input_periodic_input", + "eval.tests.test_overlapping_wfc_options.test_periodic_input_attribute_completes_run[]", + "eval.tests.test_overlapping_wfc_options.test_periodic_input_attribute_completes_run[periodicInput=\"False\"]", + "eval.tests.test_overlapping_wfc_options.test_periodic_input_attribute_completes_run[periodicInput=\"True\"]", + "eval.tests.test_overlapping_wfc_options.test_periodic_input_true_wraps_tiny_input", + "eval.tests.test_overlapping_wfc_options.test_periodic_output_attribute_completes_run[]", + "eval.tests.test_overlapping_wfc_options.test_periodic_output_attribute_completes_run[periodic=\"False\"]", + "eval.tests.test_overlapping_wfc_options.test_periodic_output_attribute_completes_run[periodic=\"True\"]", + "eval.tests.test_overlapping_wfc_options.test_symmetry_variants_complete_run[symmetry=\"1\"]", + "eval.tests.test_overlapping_wfc_options.test_symmetry_variants_complete_run[symmetry=\"2\"]", + "eval.tests.test_overlapping_wfc_options.test_symmetry_variants_complete_run[symmetry=\"3\"]", + "eval.tests.test_overlapping_wfc_options.test_symmetry_variants_complete_run[symmetry=\"4\"]", + "eval.tests.test_overlapping_wfc_options.test_symmetry_variants_complete_run[symmetry=\"8\"]", + "eval.tests.test_overlapping_wfc_toric_input.test_full_size_window_toric_pattern_fails_as_inconsistent_wave", + "eval.tests.test_overlapping_wfc_toric_input.test_toric_and_large_pattern_sampling_palette_containment[image0-palette0-True-6-6-2]", + "eval.tests.test_overlapping_wfc_toric_input.test_toric_and_large_pattern_sampling_palette_containment[image1-palette1-False-7-5-3]", + "eval.tests.test_overlapping_wfc_toric_input.test_toric_and_large_pattern_sampling_palette_containment[image2-palette2-False-10-10-7]", + "eval.tests.test_overlapping_wfc_toric_input.test_toric_and_large_pattern_sampling_palette_containment[image3-palette3-True-10-10-7]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_tiling_errors.test_missing_sample_data_xml_aborts", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_tiling_errors.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_tiling_errors.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_tiling_actionmaps.test_heterogeneous_p_backslash_propagator_solves_1x1", + "eval.tests.test_tiling_actionmaps.test_p_self_adjacent_large_grid_orientation_restriction_unsat", + "eval.tests.test_tiling_actionmaps.test_p_self_adjacent_reflection_orientation_solves_1x1[o5]", + "eval.tests.test_tiling_actionmaps.test_p_self_adjacent_reflection_orientation_solves_1x1[o6]", + "eval.tests.test_tiling_actionmaps.test_p_self_adjacent_reflection_orientation_solves_1x1[o7]", + "eval.tests.test_tiling_adjacency.test_nonzero_orientation_neighbor_nonperiodic_solves", + "eval.tests.test_tiling_adjacency.test_nonzero_orientation_neighbor_periodic_grid_unsat", + "eval.tests.test_tiling_config.test_default_subset_name_in_messages_and_output", + "eval.tests.test_tiling_config.test_explicit_subset_filters_out_tiles", + "eval.tests.test_tiling_config.test_mixed_failing_and_succeeding_elements_in_one_run", + "eval.tests.test_tiling_config.test_multiple_simpletiled_elements_run_in_order", + "eval.tests.test_tiling_config.test_orientation_qualified_neighbor_constraint_parses_and_solves", + "eval.tests.test_tiling_config.test_periodic_output_still_produces_valid_tiling", + "eval.tests.test_tiling_config.test_tile_weight_attribute_is_accepted", + "eval.tests.test_tiling_config.test_unknown_subset_name_keeps_all_tiles", + "eval.tests.test_tiling_config.test_unsat_element_does_not_fail_solving_suite_and_keeps_weighted_good", + "eval.tests.test_tiling_config.test_width_and_height_config_controls_grid", + "eval.tests.test_tiling_config.test_zero_weight_tile_is_never_placed_in_output", + "eval.tests.test_tiling_errors.test_empty_subset_tile_list_aborts", + "eval.tests.test_tiling_errors.test_invalid_symmetry_aborts", + "eval.tests.test_tiling_errors.test_missing_base_tile_image_aborts", + "eval.tests.test_tiling_errors.test_missing_per_orientation_image_aborts", + "eval.tests.test_tiling_errors.test_missing_sample_data_xml_aborts", + "eval.tests.test_tiling_errors.test_missing_samples_xml_config_is_handled_gracefully", + "eval.tests.test_tiling_errors.test_missing_tiles_node_crashes_empty_tile_vector", + "eval.tests.test_tiling_errors.test_word_backslash_rejected_but_literal_ok", + "eval.tests.test_tiling_errors.test_wrong_sized_base_image_aborts", + "eval.tests.test_tiling_output.test_backslash_symmetry_loads_two_orientations", + "eval.tests.test_tiling_output.test_i_symmetry_expands_to_two_orientations", + "eval.tests.test_tiling_output.test_orientation_counts_load_expected_number[I]", + "eval.tests.test_tiling_output.test_orientation_counts_load_expected_number[L]", + "eval.tests.test_tiling_output.test_orientation_counts_load_expected_number[P]", + "eval.tests.test_tiling_output.test_orientation_counts_load_expected_number[T]", + "eval.tests.test_tiling_output.test_orientation_counts_load_expected_number[X]", + "eval.tests.test_tiling_output.test_p_symmetry_expands_asymmetric_base_to_eight_orientations", + "eval.tests.test_tiling_output.test_rotation_symmetry_expands_asymmetric_base_to_four_orientations[L]", + "eval.tests.test_tiling_output.test_rotation_symmetry_expands_asymmetric_base_to_four_orientations[T]", + "eval.tests.test_tiling_output.test_single_tile_green_output", + "eval.tests.test_tiling_output.test_single_tile_output_blue_size3", + "eval.tests.test_tiling_output.test_single_tile_output_dimensions_and_color[sz1_w3_h2]", + "eval.tests.test_tiling_output.test_single_tile_output_dimensions_and_color[sz2_w5_h5]", + "eval.tests.test_tiling_output.test_single_tile_output_dimensions_and_color[sz3_w2_h4]", + "eval.tests.test_tiling_output.test_single_tile_output_dimensions_and_color[sz4_w3_h3]", + "eval.tests.test_tiling_output.test_single_tile_output_is_exact_solid_and_sized", + "eval.tests.test_tiling_output.test_single_tile_output_width1_height1", + "eval.tests.test_tiling_output.test_single_tile_tall_grid_output_dimensions", + "eval.tests.test_tiling_output.test_size3_asymmetric_p_tile_assembles_full_canvas", + "eval.tests.test_tiling_output.test_three_tiles_fully_connected_output_mixes_all_three_colors", + "eval.tests.test_tiling_output.test_too_many_orientation_files_are_ignored", + "eval.tests.test_tiling_output.test_two_tiles_fully_connected_output_shows_both_colors", + "eval.tests.test_tiling_output.test_x_symmetry_base_is_its_only_orientation", + "eval.tests.test_tiling_settile.test_summer_border_pinned_to_water", + "eval.tests.test_tiling_settile.test_summer_centre_pinned_to_grass", + "eval.tests.test_tiling_settile.test_summer_output_dimensions_match_grid", + "eval.tests.test_tiling_skipped_neighbors.test_multi_instance_batch_golden_ordered_protocol", + "eval.tests.test_tiling_skipped_neighbors.test_neighbor_both_sides_undefined_yields_empty_propagator", + "eval.tests.test_tiling_skipped_neighbors.test_neighbor_referencing_undefined_tile_is_skipped", + "eval.tests.test_tiling_symmetry_maps.test_all_five_symmetries_one_propagator_solves_1x1", + "eval.tests.test_tiling_symmetry_maps.test_i_symmetry_neighbor_orientation1_solves_1x1", + "eval.tests.test_tiling_symmetry_maps.test_l_symmetry_neighbor_rotation_reflection_orientation_solves_1x1[o2]", + "eval.tests.test_tiling_symmetry_maps.test_l_symmetry_neighbor_rotation_reflection_orientation_solves_1x1[o3]", + "eval.tests.test_tiling_symmetry_maps.test_l_symmetry_orientation2_non_square_row_output", + "eval.tests.test_tiling_symmetry_maps.test_x_symmetry_neighbor_solves_1x1", + "eval.tests.test_tiling_unsat.test_nonperiodic_odd_width_alternation_succeeds", + "eval.tests.test_tiling_unsat.test_periodic_even_grid_alternation_succeeds_with_checkerboard", + "eval.tests.test_tiling_unsat.test_periodic_odd_width_alternation_fails_all_retries", + "eval.tests.test_tiling_unsat.test_periodic_single_tile_still_succeeds", + "eval.tests.test_tiling_unsat.test_periodic_tall_single_column_alternation_fails" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_attribute_errors.test_fixed_run_order_when_tiling_listed_first", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_attribute_aborts[N-abc]", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_attribute_aborts[ground-abc]", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_attribute_aborts[screenshots-abc]", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_attribute_aborts[symmetry-abc]", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_attribute_aborts[width-abc]", + "eval.tests.test_attribute_errors.test_overlapping_non_numeric_height_aborts", + "eval.tests.test_attribute_errors.test_simpletiled_unknown_attributes_ignored", + "eval.tests.test_attribute_errors.test_tiling_duplicate_tile_names_dedupe", + "eval.tests.test_attribute_errors.test_tiling_non_numeric_set_size_aborts", + "eval.tests.test_attribute_errors.test_tiling_non_numeric_tile_weight_aborts", + "eval.tests.test_config_errors.test_duplicate_sibling_overlapping_nodes_run", + "eval.tests.test_config_errors.test_embedded_nul_config_aborts", + "eval.tests.test_config_errors.test_empty_config_file_aborts", + "eval.tests.test_config_errors.test_empty_samples_root_is_noop", + "eval.tests.test_config_errors.test_mismatched_close_tag_is_noop", + "eval.tests.test_config_errors.test_missing_config_file_aborts", + "eval.tests.test_config_errors.test_non_xml_config_aborts", + "eval.tests.test_config_errors.test_only_tiling_root_runs_junk_rejected", + "eval.tests.test_config_errors.test_self_closing_empty_tag_noop", + "eval.tests.test_config_errors.test_trailing_garbage_after_root_aborts", + "eval.tests.test_config_errors.test_truncated_tag_config_aborts", + "eval.tests.test_config_errors.test_unknown_attributes_ignored_one_child_runs", + "eval.tests.test_config_errors.test_unknown_root_segfaults", + "eval.tests.test_config_errors.test_uppercase_root_aborts", + "eval.tests.test_config_errors.test_whitespace_before_root_parses", + "eval.tests.test_datasets.test_castle_dataset_runs", + "eval.tests.test_datasets.test_castle_output_is_valid_rgb_png", + "eval.tests.test_datasets.test_circles_dataset_runs", + "eval.tests.test_datasets.test_knots_nonperiodic_tiling", + "eval.tests.test_output_files.test_elapsed_summary_line_format", + "eval.tests.test_output_files.test_missing_results_dir_no_crash", + "eval.tests.test_output_files.test_output_file_grows_with_size_24x24", + "eval.tests.test_output_files.test_output_named_results_subdir", + "eval.tests.test_output_files.test_output_same_sample_name_overwrites", + "eval.tests.test_output_files.test_overlap_and_tiling_share_results_dir", + "eval.tests.test_overlapping.test_overlapping_N_pattern_size", + "eval.tests.test_overlapping.test_overlapping_basic_success", + "eval.tests.test_overlapping.test_overlapping_default_dimensions_48", + "eval.tests.test_overlapping.test_overlapping_default_screenshots_two", + "eval.tests.test_overlapping.test_overlapping_ground_disabled_succeeds", + "eval.tests.test_overlapping.test_overlapping_ground_negative_minus_one_unsat", + "eval.tests.test_overlapping.test_overlapping_ground_negative_unsat_retries", + "eval.tests.test_overlapping.test_overlapping_ground_positive_unsat_retries", + "eval.tests.test_overlapping.test_overlapping_missing_image_aborts", + "eval.tests.test_overlapping.test_overlapping_missing_samples_dir_aborts", + "eval.tests.test_overlapping.test_overlapping_mixed_with_tiling_shares_results", + "eval.tests.test_overlapping.test_overlapping_multiple_distinct_names_run", + "eval.tests.test_overlapping.test_overlapping_multiple_screenshots", + "eval.tests.test_overlapping.test_overlapping_output_is_valid_rgb_png", + "eval.tests.test_overlapping.test_overlapping_periodic_default_false", + "eval.tests.test_overlapping.test_overlapping_periodic_input_false", + "eval.tests.test_overlapping.test_overlapping_periodic_input_true_explicit", + "eval.tests.test_overlapping.test_overlapping_periodic_true_explicit", + "eval.tests.test_overlapping.test_overlapping_result_png_is_distinct_from_input", + "eval.tests.test_overlapping.test_overlapping_symmetry_variants", + "eval.tests.test_overlapping.test_overlapping_uniform_ground_succeeds", + "eval.tests.test_overlapping.test_overlapping_width_height_control_output_dimensions", + "eval.tests.test_overlapping.test_overlapping_zero_screenshots_no_output", + "eval.tests.test_summer.test_summer_3x3_periodic_false_solves", + "eval.tests.test_summer.test_summer_3x3_result_is_valid_rgb_png", + "eval.tests.test_summer.test_summer_3x3_special_case_solves", + "eval.tests.test_summer.test_summer_4x4_forced_constraints_unsat", + "eval.tests.test_symmetry.test_symmetry_invalid_aborts", + "eval.tests.test_symmetry.test_symmetry_lowercase_x_rejected", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[I-symI-I]", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[L-symL-L]", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[P-symP-P]", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[T-symT-T]", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[X-symX-X]", + "eval.tests.test_symmetry.test_symmetry_valid_token_solves[backslash-symBS-\\\\]", + "eval.tests.test_tiling.test_tiling_basic_success", + "eval.tests.test_tiling.test_tiling_default_subset_tiles", + "eval.tests.test_tiling.test_tiling_dense_subset", + "eval.tests.test_tiling.test_tiling_invalid_symmetry_aborts", + "eval.tests.test_tiling.test_tiling_missing_data_xml_aborts", + "eval.tests.test_tiling.test_tiling_missing_orientation_variants_aborts", + "eval.tests.test_tiling.test_tiling_neighbors_referencing_absent_tiles_skipped", + "eval.tests.test_tiling.test_tiling_no_subset_node_all_tiles", + "eval.tests.test_tiling.test_tiling_orientation_variants_loaded", + "eval.tests.test_tiling.test_tiling_periodic_true", + "eval.tests.test_tiling.test_tiling_plain_neighbor_parses", + "eval.tests.test_tiling.test_tiling_small_subset_standard", + "eval.tests.test_tiling.test_tiling_subset_filters_tiles", + "eval.tests.test_tiling.test_tiling_subset_literally_named_tiles", + "eval.tests.test_tiling.test_tiling_tile_weight_attribute", + "eval.tests.test_tiling.test_tiling_two_subsets_of_same_sample", + "eval.tests.test_tiling.test_tiling_unknown_subset_loads_all_tiles", + "eval.tests.test_tiling.test_tiling_width_height_dimensions", + "eval.tests.test_tiling.test_tiling_wrong_tile_size_aborts" + ] + } + }, + "commit": "0edfccf8f354da79b00ebfea7b1dbee5271e9c1f", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.2027606873931997, + "eval_clean_hashes": [ + "1ec0909054ca5e543fee6b65b58f5ed4d580585cac7cb87e3c4046b426268df1" + ], + "input_record": { + "commit": "0edfccf8f354da79b00ebfea7b1dbee5271e9c1f", + "difficulty": "easy", + "difficulty_code_lines": 1595, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1595, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.2027606873931997, + "difficulty_test_code_lines": 12463, + "full_name": "math-fehr/fast-wfc", + "input_joern_zip": "cpp_joern/math-fehr__fast-wfc.zip", + "joern_status": true, + "joern_time": 15.46220787614584, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "gromacs/gromacs", + "rank": 417, + "similarity": 0.4858463704586029 + }, + { + "pb_fullname": "ip7z/7zip", + "rank": 897, + "similarity": 0.3732162117958069 + } + ], + "repo_path": "cpp/math-fehr__fast-wfc", + "source": "commit:0edfccf8f354da79b00ebfea7b1dbee5271e9c1f", + "status": "done", + "url": "https://github.com/math-fehr/fast-wfc" + }, + "instance_id": "math-fehr__fast-wfc.0edfccf", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "math-fehr/fast-wfc" +} diff --git a/math-fehr--fast-wfc.0edfccf/tests/test.sh b/math-fehr--fast-wfc.0edfccf/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/math-fehr--fast-wfc.0edfccf/tests/workspace.tar.gz b/math-fehr--fast-wfc.0edfccf/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..94a84bfa181970d67a05cba4d522d05279fde418 --- /dev/null +++ b/math-fehr--fast-wfc.0edfccf/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:941acf3123101500e8ed80b56cc3f05f8cc3fc8e679f02626098a801f414b023 +size 238171 diff --git a/matm--gocov-html.84704c2/environment/Dockerfile b/matm--gocov-html.84704c2/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/matm--gocov-html.84704c2/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/matm--gocov-html.84704c2/environment/download.sh b/matm--gocov-html.84704c2/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..6cde95f2534f656028fd9c14e08e2398cc19dd1b --- /dev/null +++ b/matm--gocov-html.84704c2/environment/download.sh @@ -0,0 +1,169 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matm/gocov-html + +go 1.11 + +require ( + github.com/axw/gocov v1.1.0 + github.com/rotisserie/eris v0.5.4 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/axw/gocov v1.1.0 h1:y5U1krExoJDlb/kNtzxyZQmNRprFOFCutWbNjcQvmVM= +github.com/axw/gocov v1.1.0/go.mod h1:H9G4tivgdN3pYSSVrTFBr6kGDCmAkgbJhtxFzAvgcdw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= +github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matm--gocov-html.84704c2/environment/executable b/matm--gocov-html.84704c2/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..c96dd72f2b3acfaf3192b3aac0af738216ca11d6 --- /dev/null +++ b/matm--gocov-html.84704c2/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3ab1a9f79765991ea5bc52dd501d9d0658a82605e1f4ae8c9a6aeed2bb4f268 +size 6446067 diff --git a/matm--gocov-html.84704c2/environment/programgym-go.tar.gz b/matm--gocov-html.84704c2/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matm--gocov-html.84704c2/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matm--gocov-html.84704c2/environment/workspace.tar.gz b/matm--gocov-html.84704c2/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4258cef0c1995c45163eef2159a9043b25b7841b --- /dev/null +++ b/matm--gocov-html.84704c2/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dd73e2b82d54fd96c03bc408a43cbf4eae11bb438ad65d4c4203c5eb1ee3ec3 +size 49884 diff --git a/matm--gocov-html.84704c2/instruction.md b/matm--gocov-html.84704c2/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/matm--gocov-html.84704c2/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/matm--gocov-html.84704c2/solution/solve.sh b/matm--gocov-html.84704c2/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/matm--gocov-html.84704c2/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/matm--gocov-html.84704c2/task.toml b/matm--gocov-html.84704c2/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ce876fb69d2554322b2863d61c957a2494cc64ec --- /dev/null +++ b/matm--gocov-html.84704c2/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/matm--gocov-html.84704c2" +description = "Synthetic ProgramGym cleanroom reconstruction task for matm/gocov-html" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "matm__gocov-html.84704c2" +repository = "matm/gocov-html" +commit = "84704c21cb6d41b92670a111e656a51822b3c627" +language = "go" +difficulty = "easy" +difficulty_score = 1.5566642621225686 +test_branches = 4 +test_count = 237 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/matm--gocov-html.84704c2/tests/Dockerfile b/matm--gocov-html.84704c2/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_01.tar.gz b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..831d2a5f5a288814ade5ddb434444d7840240c6f --- /dev/null +++ b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6534615a5bb3df8d0dd099b196aa248c9837270f238d749230b889cdf4288a18 +size 8340 diff --git a/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_02.tar.gz b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e7cb3a0162488894c77a963a99246cea7e288071 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1072c43f24e2155b2218512a700e7e9c33742a07174ffce45d49fff5b91efad5 +size 10709 diff --git a/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_03.tar.gz b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..05a47a7c814c774c383f975e61bcc59eaf82cce9 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a78d49aac9d81b6fc6fbcd95e108004858d351b0b121b6259535b134efe5cd6 +size 9233 diff --git a/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_04.tar.gz b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e418c25ff5cf690edce8c3a59416af0f220e9baa --- /dev/null +++ b/matm--gocov-html.84704c2/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f9678054669c66a27b475a379ee223e03c862b77fdc3973e40d1a9dcf84183e +size 4764 diff --git a/matm--gocov-html.84704c2/tests/download.sh b/matm--gocov-html.84704c2/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..6cde95f2534f656028fd9c14e08e2398cc19dd1b --- /dev/null +++ b/matm--gocov-html.84704c2/tests/download.sh @@ -0,0 +1,169 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matm/gocov-html + +go 1.11 + +require ( + github.com/axw/gocov v1.1.0 + github.com/rotisserie/eris v0.5.4 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/axw/gocov v1.1.0 h1:y5U1krExoJDlb/kNtzxyZQmNRprFOFCutWbNjcQvmVM= +github.com/axw/gocov v1.1.0/go.mod h1:H9G4tivgdN3pYSSVrTFBr6kGDCmAkgbJhtxFzAvgcdw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= +github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matm--gocov-html.84704c2/tests/executable b/matm--gocov-html.84704c2/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..c96dd72f2b3acfaf3192b3aac0af738216ca11d6 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3ab1a9f79765991ea5bc52dd501d9d0658a82605e1f4ae8c9a6aeed2bb4f268 +size 6446067 diff --git a/matm--gocov-html.84704c2/tests/programgym-go.tar.gz b/matm--gocov-html.84704c2/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matm--gocov-html.84704c2/tests/programgym_evaluator.py b/matm--gocov-html.84704c2/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/matm--gocov-html.84704c2/tests/programgym_task.json b/matm--gocov-html.84704c2/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..61e366d34ef56ec5685817da998d3bd1b2a7c865 --- /dev/null +++ b/matm--gocov-html.84704c2/tests/programgym_task.json @@ -0,0 +1,403 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_main_cli.test_bool_flag_with_explicit_value_parses", + "eval.tests.test_main_cli.test_cmax_above_100_is_clamped_to_100", + "eval.tests.test_main_cli.test_cmin_greater_than_cmax_even_with_valid_stdin", + "eval.tests.test_main_cli.test_cmin_greater_than_cmax_fails", + "eval.tests.test_main_cli.test_default_css_is_single_base64_line", + "eval.tests.test_main_cli.test_default_css_is_utf8_stylesheet_prefix", + "eval.tests.test_main_cli.test_default_css_outputs_before_arg_count_validation", + "eval.tests.test_main_cli.test_default_css_with_kit_theme_differs_from_golang", + "eval.tests.test_main_cli.test_document_missing_packages_key", + "eval.tests.test_main_cli.test_empty_stdin_reports_json_error", + "eval.tests.test_main_cli.test_help_lists_all_flags[--help]", + "eval.tests.test_main_cli.test_help_lists_all_flags[-h]", + "eval.tests.test_main_cli.test_help_mentions_theme_default_golang", + "eval.tests.test_main_cli.test_help_short_circuits_reading_stdin", + "eval.tests.test_main_cli.test_invalid_json_reports_parse_error", + "eval.tests.test_main_cli.test_known_themes_are_accepted", + "eval.tests.test_main_cli.test_list_themes_golang_on_first_line", + "eval.tests.test_main_cli.test_list_themes_ignores_invalid_theme_choice", + "eval.tests.test_main_cli.test_list_themes_shows_both_bundled_themes", + "eval.tests.test_main_cli.test_one_arg_missing_file_reports_open_error", + "eval.tests.test_main_cli.test_one_arg_opens_file_by_path", + "eval.tests.test_main_cli.test_report_for_no_test_files_message", + "eval.tests.test_main_cli.test_two_or_more_args_prints_usage_error", + "eval.tests.test_main_cli.test_unknown_flag_rejected_by_parser", + "eval.tests.test_main_cli.test_unknown_theme_fails_with_message", + "eval.tests.test_main_cli.test_version_controls_precedence_over_theme_list", + "eval.tests.test_main_cli.test_version_does_not_read_stdin_or_args", + "eval.tests.test_main_cli.test_version_flag_prints_all_fields", + "eval.tests.test_main_cli.test_version_go_version_is_semverish", + "eval.tests.test_main_cli.test_version_ignores_unknown_theme_and_args", + "eval.tests.test_main_cli.test_version_os_arch_nonempty", + "eval.tests.test_main_cli.test_zero_args_reads_stdin_and_generates_report", + "eval.tests.test_main_cli_validation.test_cmax_boundary_zero_keeps_only_zero_coverage", + "eval.tests.test_main_cli_validation.test_cmax_rejects_non_uint_value[ 5]", + "eval.tests.test_main_cli_validation.test_cmax_rejects_non_uint_value[-3]", + "eval.tests.test_main_cli_validation.test_cmax_rejects_non_uint_value[2x]", + "eval.tests.test_main_cli_validation.test_cmax_rejects_non_uint_value[nope]", + "eval.tests.test_main_cli_validation.test_cmax_zero_with_all_high_coverage_yields_empty_report", + "eval.tests.test_main_cli_validation.test_cmin_cmax_exact_int_window_full_only", + "eval.tests.test_main_cli_validation.test_cmin_max_boundary_keeps_only_full_coverage", + "eval.tests.test_main_cli_validation.test_cmin_parse_error_fires_before_version_output", + "eval.tests.test_main_cli_validation.test_cmin_rejects_non_uint_value[-5]", + "eval.tests.test_main_cli_validation.test_cmin_rejects_non_uint_value[1.5]", + "eval.tests.test_main_cli_validation.test_cmin_rejects_non_uint_value[]", + "eval.tests.test_main_cli_validation.test_cmin_rejects_non_uint_value[abc]", + "eval.tests.test_main_cli_validation.test_custom_stylesheet_pairing_with_kit_theme", + "eval.tests.test_main_cli_validation.test_reverse_with_cmin_filter_respects_filter_then_order", + "eval.tests.test_main_cli_validation.test_unknown_theme_blocks_default_css_output", + "eval.tests.test_report_generation.test_report_cmax_filters_high_coverage_functions", + "eval.tests.test_report_generation.test_report_cmin_cmax_inclusive_boundaries", + "eval.tests.test_report_generation.test_report_cmin_filter_tiny_and_cmax_full", + "eval.tests.test_report_generation.test_report_cmin_filters_low_coverage_functions", + "eval.tests.test_report_generation.test_report_covered_lines_not_marked_miss", + "eval.tests.test_report_generation.test_report_custom_stylesheet_inlined", + "eval.tests.test_report_generation.test_report_custom_stylesheet_replaces_embedded_css", + "eval.tests.test_report_generation.test_report_default_sort_high_coverage_first", + "eval.tests.test_report_generation.test_report_kit_theme_renders", + "eval.tests.test_report_generation.test_report_linecounts", + "eval.tests.test_report_generation.test_report_missed_lines_marked_miss", + "eval.tests.test_report_generation.test_report_missing_custom_stylesheet_fails", + "eval.tests.test_report_generation.test_report_overview_contains_package_and_functions", + "eval.tests.test_report_generation.test_report_package_total_percentage", + "eval.tests.test_report_generation.test_report_per_function_percentages", + "eval.tests.test_report_generation.test_report_reverse_flag_low_coverage_first", + "eval.tests.test_report_generation.test_report_single_package_has_no_total_overview", + "eval.tests.test_report_generation.test_report_stdin_matches_file_input", + "eval.tests.test_report_generation.test_report_two_packages_generates_total_overview", + "eval.tests.test_report_generation.test_report_unknown_file_referenced_in_json_fails" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_report_cli_errors.TestCliMetadata.test_default_css_flag_outputs_base64", + "eval.tests.test_report_cli_errors.TestCliMetadata.test_invalid_theme_rejected", + "eval.tests.test_report_cli_errors.TestCliMetadata.test_list_themes", + "eval.tests.test_report_cli_errors.TestCliMetadata.test_render_with_each_theme[golang]", + "eval.tests.test_report_cli_errors.TestCliMetadata.test_render_with_each_theme[kit]", + "eval.tests.test_report_cli_errors.TestCliMetadata.test_version_flag", + "eval.tests.test_report_cli_errors.TestCmaxClamp.test_cmax_at_or_above_100_shows_all[100]", + "eval.tests.test_report_cli_errors.TestCmaxClamp.test_cmax_at_or_above_100_shows_all[101]", + "eval.tests.test_report_cli_errors.TestCmaxClamp.test_cmax_at_or_above_100_shows_all[200]", + "eval.tests.test_report_cli_errors.TestCmaxClamp.test_cmax_at_or_above_100_shows_all[500]", + "eval.tests.test_report_cli_errors.TestInputSelection.test_missing_input_file_errors", + "eval.tests.test_report_cli_errors.TestInputSelection.test_reads_coverage_from_file_argument", + "eval.tests.test_report_cli_errors.TestInputSelection.test_reads_coverage_from_stdin", + "eval.tests.test_report_cli_errors.TestInputSelection.test_too_many_positional_args_usage", + "eval.tests.test_report_cli_errors.TestValidationErrors.test_cmin_greater_than_cmax_fatal", + "eval.tests.test_report_cli_errors.TestValidationErrors.test_missing_stylesheet_errors", + "eval.tests.test_report_cli_errors.TestValidationErrors.test_theme_selection_happens_before_report", + "eval.tests.test_report_cli_errors.TestValidationErrors.test_valid_cmin_cmax_accepted", + "eval.tests.test_report_lines.TestLineListing.test_html_escaped_in_listing", + "eval.tests.test_report_lines.TestLineListing.test_line_numbers_are_incremental", + "eval.tests.test_report_lines.TestLineListing.test_missed_line_gets_miss_class", + "eval.tests.test_report_lines.TestLineListing.test_missing_source_file_panics_process", + "eval.tests.test_report_lines.TestLineListing.test_reached_line_no_miss_class", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_empty_statements_function_is_100", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_fully_reached_function_100", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_half_reached_function_50", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_none_reached_0", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_null_statements_function_is_100", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_package_total_is_aggregated_ratio", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[0-2-0.0%]", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[1-1-100.0%]", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[1-2-50.0%]", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[2-3-66.7%]", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[3-3-100.0%]", + "eval.tests.test_report_parse_sort.TestCoveragePercent.test_statement_ratio_percentages[3-4-75.0%]", + "eval.tests.test_report_parse_sort.TestFunctionSorting.test_default_high_coverage_on_top", + "eval.tests.test_report_parse_sort.TestFunctionSorting.test_reverse_low_coverage_on_top", + "eval.tests.test_report_parse_sort.TestFunctionSorting.test_sort_ignores_removed_functions", + "eval.tests.test_report_parse_sort.TestFunctionSorting.test_tie_break_by_statement_count", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_empty_packages_array", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_invalid_json_rejected", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[42]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[[]]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[not valid]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[{\"Packages\": [}]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[{\"Packages\":]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_malformed_json_variants_fail[{]", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_null_packages_field", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_single_package_names_section", + "eval.tests.test_report_parse_sort.TestJsonParsing.test_wrong_top_level_shape_no_packages", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_accumulated_package_total_ratio", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_duplicate_package_names_accumulate", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_package_name_ordering_across_variants[names0]", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_package_name_ordering_across_variants[names1]", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_package_name_ordering_across_variants[names2]", + "eval.tests.test_report_parse_sort.TestPackageAggregation.test_packages_sorted_by_name", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmax_keeps_less_or_equal[0-expected0]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmax_keeps_less_or_equal[100-expected3]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmax_keeps_less_or_equal[50-expected1]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmax_keeps_less_or_equal[99-expected2]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_and_cmax_together[0-100-expected2]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_and_cmax_together[0-49-expected4]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_and_cmax_together[40-60-expected0]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_and_cmax_together[50-50-expected1]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_and_cmax_together[60-100-expected3]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_keeps_greater_or_equal[0-expected0]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_keeps_greater_or_equal[1-expected1]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_keeps_greater_or_equal[100-expected4]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_keeps_greater_or_equal[50-expected2]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_cmin_keeps_greater_or_equal[51-expected3]", + "eval.tests.test_report_render_filter.TestCoverageFilter.test_filter_does_not_shift_package_total", + "eval.tests.test_report_render_filter.TestRenderStructure.test_function_rows_list_file_short_name", + "eval.tests.test_report_render_filter.TestRenderStructure.test_multipackage_overall_total[1-1-1-2-66.7%]", + "eval.tests.test_report_render_filter.TestRenderStructure.test_multipackage_overall_total[1-2-0-2-25.0%]", + "eval.tests.test_report_render_filter.TestRenderStructure.test_multipackage_overall_total[1-2-1-2-50.0%]", + "eval.tests.test_report_render_filter.TestRenderStructure.test_multipackage_overall_total[2-4-1-2-50.0%]", + "eval.tests.test_report_render_filter.TestRenderStructure.test_multiple_packages_show_overview", + "eval.tests.test_report_render_filter.TestRenderStructure.test_package_done_comment_line", + "eval.tests.test_report_render_filter.TestRenderStructure.test_package_total_when_no_reached_statements", + "eval.tests.test_report_render_filter.TestRenderStructure.test_single_package_no_overview", + "eval.tests.test_report_render_filter.TestStylesheet.test_custom_stylesheet_empty_content_allowed", + "eval.tests.test_report_render_filter.TestStylesheet.test_custom_stylesheet_inlined_instead_of_default", + "eval.tests.test_report_render_filter.TestStylesheet.test_default_stylesheet_embedded_without_flag" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_theme_default_css.test_d_flag_respects_selected_registered_theme", + "eval.tests.test_theme_default_css.test_default_css_contains_coverage_colors", + "eval.tests.test_theme_default_css.test_default_css_contains_font_family_stack", + "eval.tests.test_theme_default_css.test_default_css_decodes_to_css_body_block", + "eval.tests.test_theme_default_css.test_default_css_is_base64_decodable_css", + "eval.tests.test_theme_default_css.test_default_css_prints_on_single_line", + "eval.tests.test_theme_default_css.test_default_css_sets_table_padding", + "eval.tests.test_theme_default_css.test_default_d_is_terminal_and_ignores_stdin", + "eval.tests.test_theme_default_css.test_golang_style_blob_is_stable_across_runs", + "eval.tests.test_theme_default_css.test_kit_css_decodes_to_adminkit_license_banner", + "eval.tests.test_theme_default_css.test_kit_css_uses_adminkit_custom_properties", + "eval.tests.test_theme_list.test_first_theme_is_golang_with_description", + "eval.tests.test_theme_list.test_golang_description_marks_it_as_default_theme", + "eval.tests.test_theme_list.test_golang_name_field_is_ten_char_padded", + "eval.tests.test_theme_list.test_kit_description_names_the_adminkit_source", + "eval.tests.test_theme_list.test_kit_name_field_is_padded", + "eval.tests.test_theme_list.test_list_exits_success_and_prints_registry", + "eval.tests.test_theme_list.test_list_has_exactly_two_registered_themes", + "eval.tests.test_theme_list.test_list_has_no_third_theme", + "eval.tests.test_theme_list.test_list_order_is_golang_then_kit", + "eval.tests.test_theme_list.test_list_rows_use_hyphen_separator_with_nonempty_description", + "eval.tests.test_theme_list.test_second_theme_is_kit_with_description", + "eval.tests.test_theme_report_render.test_default_theme_render_is_golang", + "eval.tests.test_theme_report_render.test_golang_and_kit_pages_differ", + "eval.tests.test_theme_report_render.test_golang_render_embeds_decoded_css_body_rule", + "eval.tests.test_theme_report_render.test_golang_render_embeds_style_in_head", + "eval.tests.test_theme_report_render.test_golang_render_empty_packages_message", + "eval.tests.test_theme_report_render.test_golang_render_empty_packages_omits_percent_summary", + "eval.tests.test_theme_report_render.test_golang_render_has_coverage_title", + "eval.tests.test_theme_report_render.test_golang_render_has_function_anchor_and_back_link", + "eval.tests.test_theme_report_render.test_golang_render_lists_package_overview", + "eval.tests.test_theme_report_render.test_golang_render_multi_package_overview_summary", + "eval.tests.test_theme_report_render.test_golang_render_multi_package_shows_command_block", + "eval.tests.test_theme_report_render.test_golang_render_percent_format_single_decimal", + "eval.tests.test_theme_report_render.test_golang_render_rejects_invalid_json_on_stderr", + "eval.tests.test_theme_report_render.test_golang_render_shows_generated_timestamp_label", + "eval.tests.test_theme_report_render.test_golang_render_shows_project_url_link", + "eval.tests.test_theme_report_render.test_golang_render_single_package_has_no_overview", + "eval.tests.test_theme_report_render.test_golang_render_single_package_summary_wrapper", + "eval.tests.test_theme_report_render.test_golang_render_zero_function_package", + "eval.tests.test_theme_report_render.test_kit_render_contains_function_anchor", + "eval.tests.test_theme_report_render.test_kit_render_embeds_adminkit_stylesheet", + "eval.tests.test_theme_report_render.test_kit_render_embeds_script_tag", + "eval.tests.test_theme_report_render.test_kit_render_empty_packages_still_emits_shell", + "eval.tests.test_theme_report_render.test_kit_render_uses_adminkit_html5_shell", + "eval.tests.test_theme_report_render.test_render_command_embeds_os_args_for_selected_theme", + "eval.tests.test_theme_report_render.test_render_reports_took_timing_on_stderr", + "eval.tests.test_theme_report_render.test_render_single_package_emits_html[golang]", + "eval.tests.test_theme_report_render.test_render_single_package_emits_html[kit]", + "eval.tests.test_theme_selection.test_empty_theme_name_fails", + "eval.tests.test_theme_selection.test_select_golang_style_blob_matches_default", + "eval.tests.test_theme_selection.test_select_golang_then_render_uses_golang_output", + "eval.tests.test_theme_selection.test_select_kit_changes_default_css_blob", + "eval.tests.test_theme_selection.test_select_kit_then_render_uses_kit_output", + "eval.tests.test_theme_selection.test_selected_kit_and_golang_styles_differ", + "eval.tests.test_theme_selection.test_theme_name_is_case_sensitive", + "eval.tests.test_theme_selection.test_theme_name_with_trailing_space_fails", + "eval.tests.test_theme_selection.test_theme_selection_error_with_d_flag", + "eval.tests.test_theme_selection.test_unknown_theme_fails", + "eval.tests.test_theme_selection.test_unknown_theme_message_quotes_name", + "eval.tests.test_theme_selection.test_unknown_theme_prints_nothing_on_stdout", + "eval.tests.test_theme_selection.test_valid_theme_is_accepted_and_prints_style[golang]", + "eval.tests.test_theme_selection.test_valid_theme_is_accepted_and_prints_style[kit]", + "eval.tests.test_theme_selection.test_valid_theme_renders_report[golang]", + "eval.tests.test_theme_selection.test_valid_theme_renders_report[kit]" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_version.test_version_block_is_six_distinct_lines", + "eval.tests.test_version.test_version_block_records_all_module_variables", + "eval.tests.test_version.test_version_disabled_does_not_print_block", + "eval.tests.test_version.test_version_disabled_still_validates_thresholds", + "eval.tests.test_version.test_version_field_spacing_is_exact", + "eval.tests.test_version.test_version_flag_prints_full_block[--v]", + "eval.tests.test_version.test_version_flag_prints_full_block[-v]", + "eval.tests.test_version.test_version_flag_writes_nothing_to_stderr", + "eval.tests.test_version.test_version_help_interaction_shows_usage", + "eval.tests.test_version.test_version_not_parsed_after_positional_argument", + "eval.tests.test_version.test_version_output_is_deterministic", + "eval.tests.test_version.test_version_repeated_flag_is_idempotent", + "eval.tests.test_version.test_version_short_circuits_cmin_bigger_than_cmax", + "eval.tests.test_version.test_version_short_circuits_extra_positional_args", + "eval.tests.test_version.test_version_short_circuits_invalid_theme", + "eval.tests.test_version.test_version_short_circuits_list_themes_flag", + "eval.tests.test_version.test_version_short_circuits_malformed_stdin", + "eval.tests.test_version.test_version_short_circuits_missing_input_file", + "eval.tests.test_version.test_version_short_circuits_show_css_flag", + "eval.tests.test_version.test_version_unknown_lumped_flag_is_rejected" + ] + } + }, + "commit": "84704c21cb6d41b92670a111e656a51822b3c627", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5566642621225686, + "eval_clean_hashes": [ + "a3ab1a9f79765991ea5bc52dd501d9d0658a82605e1f4ae8c9a6aeed2bb4f268" + ], + "input_record": { + "commit": "84704c21cb6d41b92670a111e656a51822b3c627", + "commits": 72, + "contributors": 3, + "difficulty": "easy", + "difficulty_code_lines": 1201, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1201, + "difficulty_runtime_deps": 2, + "difficulty_score": 1.5566642621225686, + "difficulty_test_code_lines": 57, + "full_name": "matm/gocov-html", + "github_stars": 229, + "input_joern_zip": "go_joern/matm__gocov-html.zip", + "joern_status": true, + "joern_time": 2.5629578239750117, + "language": "go", + "pb_match": [ + { + "pb_fullname": "go-critic/go-critic", + "rank": 785, + "similarity": 0.512873649597168 + }, + { + "pb_fullname": "mibk/dupl", + "rank": 739, + "similarity": 0.5181100368499756 + }, + { + "pb_fullname": "JohannesKaufmann/html-to-markdown", + "rank": 591, + "similarity": 0.4832625091075897 + }, + { + "pb_fullname": "mgechev/revive", + "rank": 538, + "similarity": 0.5359170436859131 + }, + { + "pb_fullname": "alecthomas/chroma", + "rank": 453, + "similarity": 0.4897778630256653 + }, + { + "pb_fullname": "mfridman/tparse", + "rank": 39, + "similarity": 0.6225776672363281 + }, + { + "pb_fullname": "cweill/gotests", + "rank": 805, + "similarity": 0.5154856443405151 + }, + { + "pb_fullname": "incu6us/goimports-reviser", + "rank": 355, + "similarity": 0.5173225998878479 + }, + { + "pb_fullname": "sibprogrammer/xq", + "rank": 409, + "similarity": 0.5014052391052246 + }, + { + "pb_fullname": "kyoh86/richgo", + "rank": 23, + "similarity": 0.6439300775527954 + }, + { + "pb_fullname": "psampaz/go-mod-outdated", + "rank": 591, + "similarity": 0.47716090083122253 + }, + { + "pb_fullname": "kisielk/errcheck", + "rank": 824, + "similarity": 0.5331610441207886 + }, + { + "pb_fullname": "hairyhenderson/gomplate", + "rank": 965, + "similarity": 0.501971960067749 + } + ], + "repo_age": 13.54, + "repo_path": "go/matm__gocov-html", + "source": "commit:84704c21cb6d41b92670a111e656a51822b3c627", + "status": "done", + "url": "https://github.com/matm/gocov-html" + }, + "instance_id": "matm__gocov-html.84704c2", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + } + ], + "repository": "matm/gocov-html" +} diff --git a/matm--gocov-html.84704c2/tests/test.sh b/matm--gocov-html.84704c2/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/matm--gocov-html.84704c2/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/matm--gocov-html.84704c2/tests/workspace.tar.gz b/matm--gocov-html.84704c2/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4258cef0c1995c45163eef2159a9043b25b7841b --- /dev/null +++ b/matm--gocov-html.84704c2/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dd73e2b82d54fd96c03bc408a43cbf4eae11bb438ad65d4c4203c5eb1ee3ec3 +size 49884 diff --git a/matsuyoshi30--germanium.e120b36/environment/Dockerfile b/matsuyoshi30--germanium.e120b36/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5cf965202bf3f2bdbe7faab773b15c8629800597 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/matsuyoshi30--germanium.e120b36/environment/download.sh b/matsuyoshi30--germanium.e120b36/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..65dd802ddbfc46a73e8a015c27358d6dd34eb7ab --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/download.sh @@ -0,0 +1,219 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matsuyoshi30/germanium + +go 1.16 + +require ( + github.com/alecthomas/chroma/v2 v2.8.0 + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 + github.com/jessevdk/go-flags v1.5.0 + github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5 + github.com/sergi/go-diff v1.2.0 // indirect + github.com/skanehira/clipboard-image/v2 v2.0.0 + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb + golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= +github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= +github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/chroma v0.9.2 h1:yU1sE2+TZbLIQPMk30SolL2Hn53SR/Pv750f7qZ/XMs= +github.com/alecthomas/chroma v0.9.2/go.mod h1:eMuEnpA18XbG/WhOWtCzJHS7WqEtDAI+HxdwoW0nVSk= +github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264= +github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw= +github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= +github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= +github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= +github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= +github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= +github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= +github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= +github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= +github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5 h1:4JX7657mlZR5yyBdvRVtEethrGhBbZHEEbphUmF627Q= +github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5/go.mod h1:btdNGMVz5UfpSWElBQM8BKrXglwtRDNSIp/RAdDfJa8= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/skanehira/clipboard-image/v2 v2.0.0 h1:Kp+RNOgIlgzDkP3EskwuBnM0Fk4sc+HgcWE5RC+PnNI= +github.com/skanehira/clipboard-image/v2 v2.0.0/go.mod h1:NXSYl4FJinIUFKJfeP1lGz8DIEUYjnEqwdMZ777S1E0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 h1:ZBu6861dZq7xBnG1bn5SRU0vA8nx42at4+kP07FMTog= +golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matsuyoshi30--germanium.e120b36/environment/executable b/matsuyoshi30--germanium.e120b36/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..b02b82ad113e99765de09d62acef89e1c16cf175 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f0263301eef77a1a9588cd935cee61813688b1667231ea3c0b239f495dc5f34 +size 8908003 diff --git a/matsuyoshi30--germanium.e120b36/environment/harbor_prepare_download_env.sh b/matsuyoshi30--germanium.e120b36/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/matsuyoshi30--germanium.e120b36/environment/programgym-go.tar.gz b/matsuyoshi30--germanium.e120b36/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matsuyoshi30--germanium.e120b36/environment/workspace.tar.gz b/matsuyoshi30--germanium.e120b36/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..28c72df85df39b45e9953a650499fb8b4cb89575 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9cb6570952aa5a2b64364f8da38f2bf119895d865b7030109f95582a264bfb7 +size 2018 diff --git a/matsuyoshi30--germanium.e120b36/instruction.md b/matsuyoshi30--germanium.e120b36/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/matsuyoshi30--germanium.e120b36/solution/solve.sh b/matsuyoshi30--germanium.e120b36/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/matsuyoshi30--germanium.e120b36/task.toml b/matsuyoshi30--germanium.e120b36/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..74de024f0a7cfa43c5fce59216ef2838bfa04f96 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/matsuyoshi30--germanium.e120b36" +description = "Synthetic ProgramGym cleanroom reconstruction task for matsuyoshi30/germanium" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "matsuyoshi30__germanium.e120b36" +repository = "matsuyoshi30/germanium" +commit = "e120b3637e3be322ab52b63d3dddcdd5d41b92cd" +language = "go" +difficulty = "easy" +difficulty_score = 1.8785217955012063 +test_branches = 4 +test_count = 317 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/matsuyoshi30--germanium.e120b36/tests/Dockerfile b/matsuyoshi30--germanium.e120b36/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18982f72e90272de65d43f035f12bce826cee126 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/Dockerfile @@ -0,0 +1,73 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_01.tar.gz b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e07591e93a6d0aca80c3b89c78df77bb843a7ab7 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c39f6c54614a75e783e31a3031f5182b7725c947f0c5658c42e829808c8064f +size 9202 diff --git a/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_02.tar.gz b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bc0a86a906496c8ba119644a66b3d38471df345b --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb1d53fb4c2593518b086c4d0f146f08beed11c6e6d744be2f85df9cc729a830 +size 11961 diff --git a/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_03.tar.gz b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..98cc2cf62e3d366e1c08d9ff6125525562784769 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67e2418c37850542a204bfa68902d41da148ff961f8e2a8fef28a53b05c9f698 +size 6581 diff --git a/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_04.tar.gz b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5eca601dbb58f9fe06e539e9869084026a2189c9 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a48c3950b8447707d6994e5087c0198f7ca099f170aedb40bb9dc66a8ee01b6d +size 6745 diff --git a/matsuyoshi30--germanium.e120b36/tests/download.sh b/matsuyoshi30--germanium.e120b36/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..65dd802ddbfc46a73e8a015c27358d6dd34eb7ab --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/download.sh @@ -0,0 +1,219 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matsuyoshi30/germanium + +go 1.16 + +require ( + github.com/alecthomas/chroma/v2 v2.8.0 + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 + github.com/jessevdk/go-flags v1.5.0 + github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5 + github.com/sergi/go-diff v1.2.0 // indirect + github.com/skanehira/clipboard-image/v2 v2.0.0 + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb + golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= +github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= +github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/chroma v0.9.2 h1:yU1sE2+TZbLIQPMk30SolL2Hn53SR/Pv750f7qZ/XMs= +github.com/alecthomas/chroma v0.9.2/go.mod h1:eMuEnpA18XbG/WhOWtCzJHS7WqEtDAI+HxdwoW0nVSk= +github.com/alecthomas/chroma/v2 v2.8.0 h1:w9WJUjFFmHHB2e8mRpL9jjy3alYDlU0QLDezj1xE264= +github.com/alecthomas/chroma/v2 v2.8.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw= +github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= +github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= +github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= +github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= +github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= +github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= +github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= +github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= +github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5 h1:4JX7657mlZR5yyBdvRVtEethrGhBbZHEEbphUmF627Q= +github.com/matsuyoshi30/go-findfont v0.0.0-20210813222338-a686fa15f1a5/go.mod h1:btdNGMVz5UfpSWElBQM8BKrXglwtRDNSIp/RAdDfJa8= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/skanehira/clipboard-image/v2 v2.0.0 h1:Kp+RNOgIlgzDkP3EskwuBnM0Fk4sc+HgcWE5RC+PnNI= +github.com/skanehira/clipboard-image/v2 v2.0.0/go.mod h1:NXSYl4FJinIUFKJfeP1lGz8DIEUYjnEqwdMZ777S1E0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750 h1:ZBu6861dZq7xBnG1bn5SRU0vA8nx42at4+kP07FMTog= +golang.org/x/sys v0.0.0-20210412220455-f1c623a9e750/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matsuyoshi30--germanium.e120b36/tests/executable b/matsuyoshi30--germanium.e120b36/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..b02b82ad113e99765de09d62acef89e1c16cf175 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f0263301eef77a1a9588cd935cee61813688b1667231ea3c0b239f495dc5f34 +size 8908003 diff --git a/matsuyoshi30--germanium.e120b36/tests/harbor_prepare_download_env.sh b/matsuyoshi30--germanium.e120b36/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/matsuyoshi30--germanium.e120b36/tests/programgym-go.tar.gz b/matsuyoshi30--germanium.e120b36/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matsuyoshi30--germanium.e120b36/tests/programgym_evaluator.py b/matsuyoshi30--germanium.e120b36/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/matsuyoshi30--germanium.e120b36/tests/programgym_task.json b/matsuyoshi30--germanium.e120b36/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..d4dada7d43eb5b8a42991bd6227a8a039582af54 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/programgym_task.json @@ -0,0 +1,443 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_entry.test_dash_without_language_requires_language", + "eval.tests.test_cli_entry.test_help_takes_precedence_over_file", + "eval.tests.test_cli_entry.test_list_fonts_exits_zero", + "eval.tests.test_cli_entry.test_list_styles_lists_many_styles", + "eval.tests.test_cli_entry.test_list_styles_prints_dracula", + "eval.tests.test_cli_entry.test_long_help_prints_usage", + "eval.tests.test_cli_entry.test_missing_flag_value_is_parse_error", + "eval.tests.test_cli_entry.test_no_args_without_input_requires_language", + "eval.tests.test_cli_entry.test_nonexistent_input_file_errors", + "eval.tests.test_cli_entry.test_short_help_prints_usage", + "eval.tests.test_cli_entry.test_unknown_flag_prints_usage_and_error", + "eval.tests.test_cli_entry.test_version_flag_without_value_is_ok", + "eval.tests.test_cli_entry.test_version_long", + "eval.tests.test_cli_entry.test_version_short", + "eval.tests.test_cli_entry.test_version_takes_precedence_over_file", + "eval.tests.test_file_io.test_background_arbitrary_rgb", + "eval.tests.test_file_io.test_background_black", + "eval.tests.test_file_io.test_background_red", + "eval.tests.test_file_io.test_background_white", + "eval.tests.test_file_io.test_default_background_is_aaaaff", + "eval.tests.test_file_io.test_default_font_renders", + "eval.tests.test_file_io.test_empty_font_size_renders_with_default", + "eval.tests.test_file_io.test_invalid_background_rejected", + "eval.tests.test_file_io.test_invalid_font_size_errors", + "eval.tests.test_file_io.test_negative_font_size_equals_form_parses", + "eval.tests.test_file_io.test_separate_token_negative_font_size_is_flag", + "eval.tests.test_file_io.test_stdin_dash_arg_with_language", + "eval.tests.test_file_io.test_stdin_empty_with_language_generates", + "eval.tests.test_file_io.test_stdin_multiline_tabs", + "eval.tests.test_file_io.test_stdin_requires_language", + "eval.tests.test_file_io.test_stdin_with_language_generates_png", + "eval.tests.test_file_io.test_system_font_renders", + "eval.tests.test_file_io.test_unknown_font_errors", + "eval.tests.test_image_gen.test_absolute_output_path", + "eval.tests.test_image_gen.test_binary_like_source_renders", + "eval.tests.test_image_gen.test_default_output_filename_is_output_png", + "eval.tests.test_image_gen.test_first_positional_wins_over_later_exe", + "eval.tests.test_image_gen.test_font_size_float_boundary", + "eval.tests.test_image_gen.test_font_size_larger_changes_content", + "eval.tests.test_image_gen.test_font_size_smaller_changes_content", + "eval.tests.test_image_gen.test_font_size_zero_boundary", + "eval.tests.test_image_gen.test_generate_png_from_file_default_flags", + "eval.tests.test_image_gen.test_invalid_style_falls_back_but_renders", + "eval.tests.test_image_gen.test_multibyte_source_renders", + "eval.tests.test_image_gen.test_no_language_still_renders_file", + "eval.tests.test_image_gen.test_no_line_number_changes_gutter", + "eval.tests.test_image_gen.test_no_line_number_still_valid", + "eval.tests.test_image_gen.test_no_line_number_with_no_bar_height", + "eval.tests.test_image_gen.test_no_window_access_bar_reduces_height", + "eval.tests.test_image_gen.test_output_overwrites_existing_file", + "eval.tests.test_image_gen.test_output_to_nonexistent_directory_fails", + "eval.tests.test_image_gen.test_relative_output_joins_cwd", + "eval.tests.test_image_gen.test_remove_extra_indent_changes_content", + "eval.tests.test_image_gen.test_remove_extra_indent_narrows", + "eval.tests.test_image_gen.test_style_changes_rendering" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_args_errors.test_flag_after_positional_is_parsed", + "eval.tests.test_args_errors.test_font_size_rejects_bare_negative_like_option", + "eval.tests.test_args_errors.test_missing_background_value", + "eval.tests.test_args_errors.test_missing_font_size_value", + "eval.tests.test_args_errors.test_missing_font_value", + "eval.tests.test_args_errors.test_missing_language_value", + "eval.tests.test_args_errors.test_missing_output_value", + "eval.tests.test_args_errors.test_missing_output_value_long", + "eval.tests.test_args_errors.test_missing_style_value", + "eval.tests.test_args_errors.test_parse_error_still_prints_usage", + "eval.tests.test_args_errors.test_unknown_flag_combined_with_output_short", + "eval.tests.test_args_errors.test_unknown_long_flag_reports_error", + "eval.tests.test_args_errors.test_unknown_short_flag_reports_error", + "eval.tests.test_flags.test_background_color_changes_render", + "eval.tests.test_flags.test_background_color_flag_renders", + "eval.tests.test_flags.test_background_invalid_color_errors", + "eval.tests.test_flags.test_background_named_color", + "eval.tests.test_flags.test_background_three_digit_hex", + "eval.tests.test_flags.test_clipboard_attempt_fails_in_headless", + "eval.tests.test_flags.test_combined_editor_flags_render", + "eval.tests.test_flags.test_default_font_explicit_renders", + "eval.tests.test_flags.test_default_style_renders", + "eval.tests.test_flags.test_font_long_flag_renders", + "eval.tests.test_flags.test_font_size_decimal_between", + "eval.tests.test_flags.test_font_size_flag_changes_render", + "eval.tests.test_flags.test_font_size_non_numeric_errors", + "eval.tests.test_flags.test_font_size_small", + "eval.tests.test_flags.test_font_size_zero_renders", + "eval.tests.test_flags.test_language_short_flag_renders_file", + "eval.tests.test_flags.test_multiline_canvas_grows_with_lines", + "eval.tests.test_flags.test_no_line_number_changes_render", + "eval.tests.test_flags.test_no_window_access_bar_changes_render", + "eval.tests.test_flags.test_remove_extra_indent_renders", + "eval.tests.test_flags.test_remove_extra_indent_shortens_render", + "eval.tests.test_flags.test_style_flag_changes_render", + "eval.tests.test_flags.test_style_long_flag_renders", + "eval.tests.test_flags.test_unknown_font_errors", + "eval.tests.test_flags.test_unknown_style_is_graceful", + "eval.tests.test_fonts.test_full_glyph_set_renders_with_mono_font", + "eval.tests.test_fonts.test_installed_family_renders_valid_png", + "eval.tests.test_fonts.test_mono_family_alters_render", + "eval.tests.test_fonts.test_non_default_font_alters_render", + "eval.tests.test_fonts.test_non_default_font_combined_with_background", + "eval.tests.test_fonts.test_non_default_font_deterministic", + "eval.tests.test_fonts.test_non_default_font_hides_editor", + "eval.tests.test_fonts.test_non_default_font_with_style_flag", + "eval.tests.test_fonts.test_serif_family_alters_render", + "eval.tests.test_help_version.test_help_does_not_create_output_file", + "eval.tests.test_help_version.test_help_does_not_touch_stdin", + "eval.tests.test_help_version.test_help_exits_zero", + "eval.tests.test_help_version.test_help_lists_background_flag", + "eval.tests.test_help_version.test_help_lists_clipboard_flag", + "eval.tests.test_help_version.test_help_lists_font_flag", + "eval.tests.test_help_version.test_help_lists_language_flag", + "eval.tests.test_help_version.test_help_lists_list_fonts_flag", + "eval.tests.test_help_version.test_help_lists_list_styles_flag", + "eval.tests.test_help_version.test_help_lists_no_access_bar_flag", + "eval.tests.test_help_version.test_help_lists_no_line_number_flag", + "eval.tests.test_help_version.test_help_lists_output_flag", + "eval.tests.test_help_version.test_help_lists_remove_extra_indent_flag", + "eval.tests.test_help_version.test_help_lists_style_flag", + "eval.tests.test_help_version.test_help_lists_version_flag", + "eval.tests.test_help_version.test_help_short_exits_zero", + "eval.tests.test_help_version.test_help_usage_line", + "eval.tests.test_help_version.test_version_long", + "eval.tests.test_help_version.test_version_prints_single_line", + "eval.tests.test_help_version.test_version_short", + "eval.tests.test_help_version.test_version_wins_over_missing_input", + "eval.tests.test_list.test_list_fonts_exits_zero", + "eval.tests.test_list.test_list_fonts_mentions_installed_dejavu", + "eval.tests.test_list.test_list_fonts_no_side_effect_file", + "eval.tests.test_list.test_list_fonts_prints_font_names_only", + "eval.tests.test_list.test_list_styles_contains_dracula", + "eval.tests.test_list.test_list_styles_contains_required_block", + "eval.tests.test_list.test_list_styles_count_is_substantial", + "eval.tests.test_list.test_list_styles_exits_zero", + "eval.tests.test_list.test_list_styles_no_side_effect_file", + "eval.tests.test_list.test_list_styles_output_is_space_separated_tokens", + "eval.tests.test_list.test_list_styles_with_stdin_still_lists", + "eval.tests.test_output.test_absolute_output_path", + "eval.tests.test_output.test_default_output_disappears_from_root", + "eval.tests.test_output.test_default_output_name", + "eval.tests.test_output.test_output_canvas_dimensions", + "eval.tests.test_output.test_output_long_flag", + "eval.tests.test_output.test_output_overwrites_existing_file", + "eval.tests.test_output.test_output_to_dir_errors", + "eval.tests.test_output.test_output_to_nonexistent_dir_errors", + "eval.tests.test_output.test_png_signature_emitted", + "eval.tests.test_output.test_relative_output_into_existing_subdir", + "eval.tests.test_output.test_relative_output_missing_subdir_errors", + "eval.tests.test_output.test_relative_output_resolved_against_cwd", + "eval.tests.test_stdin_dispatch.test_dash_filename_means_stdin", + "eval.tests.test_stdin_dispatch.test_dash_filename_with_language_renders", + "eval.tests.test_stdin_dispatch.test_directory_input_errors", + "eval.tests.test_stdin_dispatch.test_empty_file_renders", + "eval.tests.test_stdin_dispatch.test_extra_positional_uses_first", + "eval.tests.test_stdin_dispatch.test_file_input_renders", + "eval.tests.test_stdin_dispatch.test_missing_file_errors", + "eval.tests.test_stdin_dispatch.test_stdin_python_language_renders", + "eval.tests.test_stdin_dispatch.test_stdin_requires_language_even_with_output", + "eval.tests.test_stdin_dispatch.test_stdin_with_language_long_flag", + "eval.tests.test_stdin_dispatch.test_stdin_with_language_renders", + "eval.tests.test_stdin_dispatch.test_stdin_without_language_and_empty", + "eval.tests.test_stdin_dispatch.test_stdin_without_language_errors", + "eval.tests.test_stdin_dispatch.test_tab_expansion_in_input" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_panel.test_default_style_is_dracula", + "eval.tests.test_panel.test_draw_accepts_valid_background_colors[#aabbcc-190-234]", + "eval.tests.test_panel.test_draw_accepts_valid_background_colors[#abc-190-234]", + "eval.tests.test_panel.test_draw_accepts_valid_background_colors[#abcd-190-234]", + "eval.tests.test_panel.test_draw_accepts_valid_background_colors[11223344-190-234]", + "eval.tests.test_panel.test_draw_accepts_valid_background_colors[123456-190-234]", + "eval.tests.test_panel.test_draw_builds_window_with_named_style[dracula]", + "eval.tests.test_panel.test_draw_builds_window_with_named_style[github]", + "eval.tests.test_panel.test_draw_builds_window_with_named_style[monokai]", + "eval.tests.test_panel.test_draw_builds_window_with_named_style[solarized-dark]", + "eval.tests.test_panel.test_draw_non_hex_digits_map_to_zero_and_render[#qqqqqq]", + "eval.tests.test_panel.test_draw_non_hex_digits_map_to_zero_and_render[gGgggg]", + "eval.tests.test_panel.test_draw_non_hex_digits_map_to_zero_and_render[ggg]", + "eval.tests.test_panel.test_draw_non_hex_digits_map_to_zero_and_render[zzzzzz]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[##]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[#9]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[#abcdefg]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[aabbccddee]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[ab]", + "eval.tests.test_panel.test_draw_rejects_invalid_background_color_length[abcde]", + "eval.tests.test_panel.test_empty_file_no_bar_dimensions", + "eval.tests.test_panel.test_empty_file_produces_valid_png", + "eval.tests.test_panel.test_font_size_increases_height_monotonically", + "eval.tests.test_panel.test_height_scales_with_font_size[12-267]", + "eval.tests.test_panel.test_height_scales_with_font_size[16-296]", + "eval.tests.test_panel.test_height_scales_with_font_size[20-325]", + "eval.tests.test_panel.test_height_scales_with_font_size[24-354]", + "eval.tests.test_panel.test_height_scales_with_font_size[36-441]", + "eval.tests.test_panel.test_height_scales_with_font_size[48-528]", + "eval.tests.test_panel.test_height_scales_with_font_size_no_bar[12-207]", + "eval.tests.test_panel.test_height_scales_with_font_size_no_bar[24-294]", + "eval.tests.test_panel.test_height_scales_with_font_size_no_bar[48-468]", + "eval.tests.test_panel.test_height_scales_with_line_count[0-204]", + "eval.tests.test_panel.test_height_scales_with_line_count[1-234]", + "eval.tests.test_panel.test_height_scales_with_line_count[10-504]", + "eval.tests.test_panel.test_height_scales_with_line_count[2-264]", + "eval.tests.test_panel.test_height_scales_with_line_count[20-804]", + "eval.tests.test_panel.test_height_scales_with_line_count[3-294]", + "eval.tests.test_panel.test_height_scales_with_line_count[5-354]", + "eval.tests.test_panel.test_height_scales_with_line_count[8-444]", + "eval.tests.test_panel.test_height_without_access_bar[0-144]", + "eval.tests.test_panel.test_height_without_access_bar[1-174]", + "eval.tests.test_panel.test_height_without_access_bar[10-444]", + "eval.tests.test_panel.test_height_without_access_bar[2-204]", + "eval.tests.test_panel.test_height_without_access_bar[5-294]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_extension[nolang]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_extension[qdata]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_extension[zzz]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_language[notareallang]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_language[qxx9]", + "eval.tests.test_panel.test_label_fallback_lexer_for_unknown_language[zzznoext]", + "eval.tests.test_panel.test_label_known_language_does_not_fall_back", + "eval.tests.test_panel.test_line_number_width_constant_regardless_of_digits", + "eval.tests.test_panel.test_multibyte_runes_count_as_single_column", + "eval.tests.test_panel.test_newimage_accepts_long_line_without_scanner_error[1000-15175]", + "eval.tests.test_panel.test_newimage_accepts_long_line_without_scanner_error[5000-75175]", + "eval.tests.test_panel.test_newimage_accepts_long_line_without_scanner_error[8000-120175]", + "eval.tests.test_panel.test_newimage_rejects_oversized_line_via_stdin", + "eval.tests.test_panel.test_newimage_rejects_single_line_over_scanner_limit", + "eval.tests.test_panel.test_no_line_number_keeps_dimensions[12]", + "eval.tests.test_panel.test_no_line_number_keeps_dimensions[1]", + "eval.tests.test_panel.test_no_line_number_keeps_dimensions[5]", + "eval.tests.test_panel.test_rune_counting_variants[\\u65e5\\u672c\\u8a9e\\u3067\\u3059-250]", + "eval.tests.test_panel.test_rune_counting_variants[a\\tb-265]", + "eval.tests.test_panel.test_rune_counting_variants[h\\xe9llo-250]", + "eval.tests.test_panel.test_rune_counting_variants[w\\xfcr-220]", + "eval.tests.test_panel.test_single_blank_line_dimensions", + "eval.tests.test_panel.test_stdin_requires_language", + "eval.tests.test_panel.test_stdin_tab_expansion_dims", + "eval.tests.test_panel.test_stdin_with_language_renders_png", + "eval.tests.test_panel.test_tab_expanded_to_four_spaces_for_width", + "eval.tests.test_panel.test_tab_only_line_width", + "eval.tests.test_panel.test_trailing_newline_counts_no_extra_line", + "eval.tests.test_panel.test_width_increases_with_line_length", + "eval.tests.test_panel.test_width_scales_with_longest_line[0-175]", + "eval.tests.test_panel.test_width_scales_with_longest_line[1-190]", + "eval.tests.test_panel.test_width_scales_with_longest_line[10-325]", + "eval.tests.test_panel.test_width_scales_with_longest_line[100-1675]", + "eval.tests.test_panel.test_width_scales_with_longest_line[2-205]", + "eval.tests.test_panel.test_width_scales_with_longest_line[3-220]", + "eval.tests.test_panel.test_width_scales_with_longest_line[5-250]", + "eval.tests.test_panel.test_width_scales_with_longest_line[50-925]", + "eval.tests.test_panel.test_width_uses_longest_line_across_mixed_lengths", + "eval.tests.test_panel.test_window_access_bar_adds_exactly_60_px_height" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_formatter_cli.test_absolute_output_path", + "eval.tests.test_formatter_cli.test_empty_background_color_panics", + "eval.tests.test_formatter_cli.test_explicit_language_dispatch_renders[go-tiny]", + "eval.tests.test_formatter_cli.test_explicit_language_dispatch_renders[go]", + "eval.tests.test_formatter_cli.test_explicit_language_dispatch_renders[javascript]", + "eval.tests.test_formatter_cli.test_explicit_language_dispatch_renders[python]", + "eval.tests.test_formatter_cli.test_explicit_language_dispatch_renders[yaml]", + "eval.tests.test_formatter_cli.test_help_prints_usage_and_exits_zero", + "eval.tests.test_formatter_cli.test_invalid_background_color_errors", + "eval.tests.test_formatter_cli.test_invalid_font_size_errors", + "eval.tests.test_formatter_cli.test_invalid_style_falls_back_gracefully", + "eval.tests.test_formatter_cli.test_list_styles_prints_style_names", + "eval.tests.test_formatter_cli.test_missing_input_file_errors", + "eval.tests.test_formatter_cli.test_output_defaults_to_output_png_in_cwd", + "eval.tests.test_formatter_cli.test_remove_extra_indent_changes_output", + "eval.tests.test_formatter_cli.test_remove_extra_indent_is_self_consistent", + "eval.tests.test_formatter_cli.test_render_go_file_to_png", + "eval.tests.test_formatter_cli.test_stdin_no_argument_is_treated_as_stdin_without_language", + "eval.tests.test_formatter_cli.test_stdin_requires_language_flag", + "eval.tests.test_formatter_cli.test_stdin_with_language_renders_png", + "eval.tests.test_formatter_cli.test_three_and_four_and_six_and_eight_digit_colors_are_valid", + "eval.tests.test_formatter_cli.test_unknown_flag_is_rejected", + "eval.tests.test_formatter_cli.test_version_flag_prints_name_and_version", + "eval.tests.test_formatter_png.test_bigger_font_is_monotonic_in_size", + "eval.tests.test_formatter_png.test_height_grows_with_line_count[1]", + "eval.tests.test_formatter_png.test_height_grows_with_line_count[3]", + "eval.tests.test_formatter_png.test_height_grows_with_line_count[5]", + "eval.tests.test_formatter_png.test_height_grows_with_line_count[8]", + "eval.tests.test_formatter_png.test_larger_font_yields_larger_image[12]", + "eval.tests.test_formatter_png.test_larger_font_yields_larger_image[24]", + "eval.tests.test_formatter_png.test_larger_font_yields_larger_image[48]", + "eval.tests.test_formatter_png.test_longer_line_yields_wider_image", + "eval.tests.test_formatter_png.test_more_lines_yield_taller_image", + "eval.tests.test_formatter_png.test_no_window_access_bar_removes_exactly_60px_height", + "eval.tests.test_formatter_png.test_png_ihdr_chunk_is_valid", + "eval.tests.test_formatter_png.test_render_produces_valid_png[empty-content]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[go-package]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[indented-lines]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[python-loop]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[single-char]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[single-line]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[tab-separated]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[three-lines]", + "eval.tests.test_formatter_png.test_render_produces_valid_png[trailing-spaces]", + "eval.tests.test_formatter_png.test_same_input_is_deterministic", + "eval.tests.test_formatter_png.test_width_grows_with_longest_line[1]", + "eval.tests.test_formatter_png.test_width_grows_with_longest_line[20]", + "eval.tests.test_formatter_png.test_width_grows_with_longest_line[40]", + "eval.tests.test_formatter_png.test_width_grows_with_longest_line[80]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#000000]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#00aa00]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#282a36]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#fafafa]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#ff6600]", + "eval.tests.test_formatter_styles.test_background_colour_renders[#ffffff]", + "eval.tests.test_formatter_styles.test_black_versus_white_background_changes_contrast_fallback", + "eval.tests.test_formatter_styles.test_different_styles_yield_different_glyph_payload[dracula-autumn]", + "eval.tests.test_formatter_styles.test_different_styles_yield_different_glyph_payload[monokai-github]", + "eval.tests.test_formatter_styles.test_different_styles_yield_different_glyph_payload[solarized-dark-nord]", + "eval.tests.test_formatter_styles.test_line_number_and_panel_flags_keep_valid_png", + "eval.tests.test_formatter_styles.test_multi_digit_line_count_still_renders[10]", + "eval.tests.test_formatter_styles.test_multi_digit_line_count_still_renders[99]", + "eval.tests.test_formatter_styles.test_multi_digit_line_count_still_renders[9]", + "eval.tests.test_formatter_styles.test_no_line_number_flag_reduces_payload", + "eval.tests.test_formatter_styles.test_same_style_is_stable_across_runs", + "eval.tests.test_formatter_styles.test_style_produces_render[autumn]", + "eval.tests.test_formatter_styles.test_style_produces_render[base16-snazzy]", + "eval.tests.test_formatter_styles.test_style_produces_render[bw]", + "eval.tests.test_formatter_styles.test_style_produces_render[dracula]", + "eval.tests.test_formatter_styles.test_style_produces_render[github]", + "eval.tests.test_formatter_styles.test_style_produces_render[monokai]", + "eval.tests.test_formatter_styles.test_style_produces_render[nord]", + "eval.tests.test_formatter_styles.test_style_produces_render[solarized-dark]" + ] + } + }, + "commit": "e120b3637e3be322ab52b63d3dddcdd5d41b92cd", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.8785217955012063, + "eval_clean_hashes": [ + "5f0263301eef77a1a9588cd935cee61813688b1667231ea3c0b239f495dc5f34" + ], + "input_record": { + "commit": "e120b3637e3be322ab52b63d3dddcdd5d41b92cd", + "commits": 131, + "contributors": 6, + "difficulty": "easy", + "difficulty_code_lines": 840, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 840, + "difficulty_runtime_deps": 8, + "difficulty_score": 1.8785217955012063, + "difficulty_test_code_lines": 120, + "full_name": "matsuyoshi30/germanium", + "github_stars": 214, + "input_joern_zip": "go_joern/matsuyoshi30__germanium.zip", + "joern_status": true, + "joern_time": 9.113962043076754, + "language": "go", + "pb_match": [ + { + "pb_fullname": "alecthomas/chroma", + "rank": 121, + "similarity": 0.5422481298446655 + }, + { + "pb_fullname": "boyter/scc", + "rank": 623, + "similarity": 0.5003455281257629 + }, + { + "pb_fullname": "sibprogrammer/xq", + "rank": 911, + "similarity": 0.4697369933128357 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 27, + "similarity": 0.6244003176689148 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 43, + "similarity": 0.5647603869438171 + } + ], + "repo_age": 5.45, + "repo_path": "go/matsuyoshi30__germanium", + "source": "commit:e120b3637e3be322ab52b63d3dddcdd5d41b92cd", + "status": "done", + "url": "https://github.com/matsuyoshi30/germanium" + }, + "instance_id": "matsuyoshi30__germanium.e120b36", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 1, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "matsuyoshi30/germanium" +} diff --git a/matsuyoshi30--germanium.e120b36/tests/test.sh b/matsuyoshi30--germanium.e120b36/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/matsuyoshi30--germanium.e120b36/tests/workspace.tar.gz b/matsuyoshi30--germanium.e120b36/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..28c72df85df39b45e9953a650499fb8b4cb89575 --- /dev/null +++ b/matsuyoshi30--germanium.e120b36/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9cb6570952aa5a2b64364f8da38f2bf119895d865b7030109f95582a264bfb7 +size 2018 diff --git a/matsuyoshi30--gitsu.72f9b67/environment/Dockerfile b/matsuyoshi30--gitsu.72f9b67/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5cf965202bf3f2bdbe7faab773b15c8629800597 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/matsuyoshi30--gitsu.72f9b67/environment/download.sh b/matsuyoshi30--gitsu.72f9b67/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..212e04e651e0bd5c6490fa5c38225723dd8a8514 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/download.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matsuyoshi30/gitsu + +go 1.15 + +require ( + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d + github.com/manifoldco/promptui v0.8.0 + github.com/urfave/cli/v2 v2.3.0 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw= +github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/manifoldco/promptui v0.8.0 h1:R95mMF+McvXZQ7j1g8ucVZE1gLP3Sv6j9vlF9kyRqQo= +github.com/manifoldco/promptui v0.8.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b h1:MQE+LT/ABUuuvEZ+YQAMSXindAdUh7slEmAkup74op4= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matsuyoshi30--gitsu.72f9b67/environment/executable b/matsuyoshi30--gitsu.72f9b67/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..b22307aa584d4f93c0eb5c8b7ba99178a9aa1323 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc7a2acda3e923c9a9afe2adea7f7795b4a8ad55da404d1d4c1b692a8253421 +size 8700563 diff --git a/matsuyoshi30--gitsu.72f9b67/environment/harbor_prepare_download_env.sh b/matsuyoshi30--gitsu.72f9b67/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/matsuyoshi30--gitsu.72f9b67/environment/programgym-go.tar.gz b/matsuyoshi30--gitsu.72f9b67/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matsuyoshi30--gitsu.72f9b67/environment/workspace.tar.gz b/matsuyoshi30--gitsu.72f9b67/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9180fc1d541484d81d5d0c43336f80715ed99bdc --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e012a42ced39faaf7a0303aa33f3a4eeed1d706452771b1d4c9704fdf752d17b +size 1496110 diff --git a/matsuyoshi30--gitsu.72f9b67/instruction.md b/matsuyoshi30--gitsu.72f9b67/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/matsuyoshi30--gitsu.72f9b67/solution/solve.sh b/matsuyoshi30--gitsu.72f9b67/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/matsuyoshi30--gitsu.72f9b67/task.toml b/matsuyoshi30--gitsu.72f9b67/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ded813e4cb2a2e99db820d81b1572d8999ca67a2 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/matsuyoshi30--gitsu.72f9b67" +description = "Synthetic ProgramGym cleanroom reconstruction task for matsuyoshi30/gitsu" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "matsuyoshi30__gitsu.72f9b67" +repository = "matsuyoshi30/gitsu" +commit = "72f9b67f120fe186e1124103249a9f41a68e3685" +language = "go" +difficulty = "easy" +difficulty_score = 1.610234175334389 +test_branches = 4 +test_count = 312 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/matsuyoshi30--gitsu.72f9b67/tests/Dockerfile b/matsuyoshi30--gitsu.72f9b67/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18982f72e90272de65d43f035f12bce826cee126 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/Dockerfile @@ -0,0 +1,73 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_01.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b1b5caf2f5c6ebb7f644ee78de94c98c7381e008 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c2231671ff5cd16dd26015a21d9d5886018299c6474b84a23cb4b053ca625cb +size 14926 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_02.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cc6acedd1b5c814124b98fd6b625177ba7a497d9 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05d25fa9a88190b154091829decb97c9a0ba43047bc407abb3822abf43b25014 +size 12380 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_03.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..37bb2fa1168a988dcbeef05d9385e7a9ceee95da --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd65307488894720724c35eb4f21cfee4097ca18f02ef50f1da27f4ef3da95f8 +size 14152 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_04.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5e63a586543170419a8ab9f4887f2ef605e6a47d --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aaf291a2f90f1000ec45291f20756b644cc98b283d2cf8b2ff3f05cf5e361cb8 +size 11028 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/download.sh b/matsuyoshi30--gitsu.72f9b67/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..212e04e651e0bd5c6490fa5c38225723dd8a8514 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/download.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/matsuyoshi30/gitsu + +go 1.15 + +require ( + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d + github.com/manifoldco/promptui v0.8.0 + github.com/urfave/cli/v2 v2.3.0 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a h1:FaWFmfWdAUKbSCtOU2QjDaorUexogfaMgbipgYATUMU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw= +github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/manifoldco/promptui v0.8.0 h1:R95mMF+McvXZQ7j1g8ucVZE1gLP3Sv6j9vlF9kyRqQo= +github.com/manifoldco/promptui v0.8.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b h1:MQE+LT/ABUuuvEZ+YQAMSXindAdUh7slEmAkup74op4= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +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 + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/matsuyoshi30--gitsu.72f9b67/tests/executable b/matsuyoshi30--gitsu.72f9b67/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..b22307aa584d4f93c0eb5c8b7ba99178a9aa1323 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc7a2acda3e923c9a9afe2adea7f7795b4a8ad55da404d1d4c1b692a8253421 +size 8700563 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/harbor_prepare_download_env.sh b/matsuyoshi30--gitsu.72f9b67/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/matsuyoshi30--gitsu.72f9b67/tests/programgym-go.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/programgym_evaluator.py b/matsuyoshi30--gitsu.72f9b67/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/matsuyoshi30--gitsu.72f9b67/tests/programgym_task.json b/matsuyoshi30--gitsu.72f9b67/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..89797e3253605f3e473bf07c9124ae2d54c29ae9 --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/programgym_task.json @@ -0,0 +1,418 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_module_01_cli.test_add_help_lists_gpg_flag", + "eval.tests.test_module_01_cli.test_flagless_commands_have_no_custom_options[delete]", + "eval.tests.test_module_01_cli.test_flagless_commands_have_no_custom_options[modify]", + "eval.tests.test_module_01_cli.test_flagless_commands_have_no_custom_options[reset]", + "eval.tests.test_module_01_cli.test_h_flag_prints_root_usage", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[a-exp0]", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[d-exp1]", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[i-exp2]", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[m-exp3]", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[r-exp4]", + "eval.tests.test_module_01_cli.test_help_alias_resolves_to_command[s-exp5]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[add-Add new user]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[delete-Delete existing user]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[init-Initialize user config by providing an alias]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[modify-Modify existing user]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[reset-Remove all saved user profiles]", + "eval.tests.test_module_01_cli.test_help_command_shows_subcommand_name_and_usage[select-Select existing user]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[add-Add new user]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[delete-Delete existing user]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[init-Initialize user config by providing an alias]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[modify-Modify existing user]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[reset-Remove all saved user profiles]", + "eval.tests.test_module_01_cli.test_help_command_via_short_dash_flag[select-Select existing user]", + "eval.tests.test_module_01_cli.test_help_flag_lists_all_commands", + "eval.tests.test_module_01_cli.test_help_subcommand_prints_root_usage", + "eval.tests.test_module_01_cli.test_init_help_lists_global_flag", + "eval.tests.test_module_01_cli.test_root_global_options_section_present", + "eval.tests.test_module_01_cli.test_root_name_and_app_usage_line", + "eval.tests.test_module_01_cli.test_select_help_lists_global_flag", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[add-Add new user]", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[delete-Delete existing user]", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[init-Initialize user config by providing an alias]", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[modify-Modify existing user]", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[reset-Remove all saved user profiles]", + "eval.tests.test_module_01_cli.test_subcommand_double_dash_help[select-Select existing user]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[add-Add new user]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[delete-Delete existing user]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[init-Initialize user config by providing an alias]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[modify-Modify existing user]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[reset-Remove all saved user profiles]", + "eval.tests.test_module_01_cli.test_subcommand_short_help_flag[select-Select existing user]", + "eval.tests.test_module_01_cli.test_unknown_global_flag_is_rejected", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[add]", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[delete]", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[init]", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[modify]", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[reset]", + "eval.tests.test_module_01_cli.test_unknown_subcommand_flag_is_rejected[select]", + "eval.tests.test_module_01_cli.test_version_flag_is_unsupported", + "eval.tests.test_module_01_init.test_init_alias_case_sensitive", + "eval.tests.test_module_01_init.test_init_alias_local_sets_git_user_without_gpg", + "eval.tests.test_module_01_init.test_init_alias_named_default_uses_alias_path", + "eval.tests.test_module_01_init.test_init_alias_sets_global_git_user[with-gpg-key]", + "eval.tests.test_module_01_init.test_init_alias_sets_global_git_user[without-gpg-key]", + "eval.tests.test_module_01_init.test_init_blank_alias_maps_to_default_user", + "eval.tests.test_module_01_init.test_init_empty_alias_local_inside_worktree", + "eval.tests.test_module_01_init.test_init_empty_alias_selects_default_user", + "eval.tests.test_module_01_init.test_init_empty_alias_with_no_default_user_fails", + "eval.tests.test_module_01_init.test_init_flag_after_alias_is_not_bound_as_global", + "eval.tests.test_module_01_init.test_init_global_skips_worktree_requirement", + "eval.tests.test_module_01_init.test_init_global_with_unknown_alias_fails", + "eval.tests.test_module_01_init.test_init_global_writes_only_global_config", + "eval.tests.test_module_01_init.test_init_local_accepts_inside_git_worktree", + "eval.tests.test_module_01_init.test_init_local_rejects_non_worktree_directory", + "eval.tests.test_module_01_init.test_init_multiple_users_selects_by_exact_alias", + "eval.tests.test_module_01_init.test_init_no_users_ignores_global_flag[global-flag]", + "eval.tests.test_module_01_init.test_init_no_users_ignores_global_flag[no-flag]", + "eval.tests.test_module_01_init.test_init_output_has_no_trailing_newline", + "eval.tests.test_module_01_init.test_init_reports_malformed_json_config_error", + "eval.tests.test_module_01_init.test_init_spaces_only_alias_is_a_real_nonmatching_alias", + "eval.tests.test_module_01_init.test_init_unknown_alias_local_inside_worktree", + "eval.tests.test_module_01_init.test_init_uses_first_positional_alias_only", + "eval.tests.test_module_01_init.test_init_with_no_config_file_reports_error", + "eval.tests.test_module_01_init.test_init_with_no_users_prints_no_users[absent-users-key]", + "eval.tests.test_module_01_init.test_init_with_no_users_prints_no_users[empty-array]", + "eval.tests.test_module_01_init.test_init_with_no_users_prints_no_users[null-users]", + "eval.tests.test_module_01_modify.test_modify_alias_empty_users_short_circuits", + "eval.tests.test_module_01_modify.test_modify_all_fields_updates_config", + "eval.tests.test_module_01_modify.test_modify_partial_fields_only_change_that_field[alias-only]", + "eval.tests.test_module_01_modify.test_modify_partial_fields_only_change_that_field[email-only]", + "eval.tests.test_module_01_modify.test_modify_partial_fields_only_change_that_field[name-only]", + "eval.tests.test_module_01_modify.test_modify_preserves_gpg_key_when_gpg_not_prompted", + "eval.tests.test_module_01_modify.test_modify_rejects_alias_collision", + "eval.tests.test_module_01_modify.test_modify_rejects_exact_name_email_collision", + "eval.tests.test_module_01_modify.test_modify_rewrites_valid_config_as_indented_json", + "eval.tests.test_module_01_modify.test_modify_selects_first_user_when_multiple_present", + "eval.tests.test_module_01_modify.test_modify_selects_second_user_with_down_arrow", + "eval.tests.test_module_01_modify.test_modify_via_alias_with_no_config_reports_error", + "eval.tests.test_module_01_modify.test_modify_with_all_fields_empty_changes_nothing", + "eval.tests.test_module_01_modify.test_modify_with_malformed_config_reports_parse_error", + "eval.tests.test_module_01_modify.test_modify_with_no_config_reports_error", + "eval.tests.test_module_01_modify.test_modify_with_no_users_prints_no_users[absent-users-key]", + "eval.tests.test_module_01_modify.test_modify_with_no_users_prints_no_users[empty-array]", + "eval.tests.test_module_01_modify.test_modify_with_no_users_prints_no_users[null-users]", + "eval.tests.test_module_01_select.test_select_first_user_when_multiple_present", + "eval.tests.test_module_01_select.test_select_global_overrides_existing_git_user", + "eval.tests.test_module_01_select.test_select_global_sets_git_user_config", + "eval.tests.test_module_01_select.test_select_global_sets_gpg_signing_key", + "eval.tests.test_module_01_select.test_select_global_unsets_stale_signing_key", + "eval.tests.test_module_01_select.test_select_global_via_alias_dispatches[alias-s]", + "eval.tests.test_module_01_select.test_select_local_does_not_touch_global_config", + "eval.tests.test_module_01_select.test_select_local_in_worktree_sets_local_config", + "eval.tests.test_module_01_select.test_select_local_requires_worktree", + "eval.tests.test_module_01_select.test_select_second_user_with_down_arrow", + "eval.tests.test_module_01_select.test_select_via_alias_with_no_config_reports_error", + "eval.tests.test_module_01_select.test_select_with_no_config_reports_error", + "eval.tests.test_module_01_select.test_select_with_no_users_prints_no_users[absent-users-key]", + "eval.tests.test_module_01_select.test_select_with_no_users_prints_no_users[empty-array]", + "eval.tests.test_module_01_select.test_select_with_no_users_prints_no_users[null-users]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_prompts_add.test_add_duplicate_alias_rejected", + "eval.tests.test_prompts_add.test_add_duplicate_name_email_rejected", + "eval.tests.test_prompts_add.test_add_returns_nonzero_without_pty_terminal_prompt", + "eval.tests.test_prompts_add.test_add_user_leaving_alias_empty", + "eval.tests.test_prompts_add.test_add_user_writes_exact_fields[Ada Lovelace-ada@example.com-ada]", + "eval.tests.test_prompts_add.test_add_user_writes_exact_fields[Grace Hopper-grace@example.com-grace]", + "eval.tests.test_prompts_add.test_add_user_writes_exact_fields[Linus-linus@example.com-torvalds]", + "eval.tests.test_prompts_add.test_add_with_gpg_flag_prompts_and_stores_key", + "eval.tests.test_prompts_add.test_add_without_gpg_skips_key_prompt", + "eval.tests.test_prompts_add.test_invalid_email_reprompts_until_valid", + "eval.tests.test_prompts_add.test_terminal_output_contains_no_bell_byte", + "eval.tests.test_prompts_edges.test_config_file_missing_reports_error[delete]", + "eval.tests.test_prompts_edges.test_config_file_missing_reports_error[modify]", + "eval.tests.test_prompts_edges.test_config_file_missing_reports_error[reset]", + "eval.tests.test_prompts_edges.test_config_file_missing_reports_error[select]", + "eval.tests.test_prompts_edges.test_ctrl_c_aborts_input_prompt", + "eval.tests.test_prompts_edges.test_ctrl_c_aborts_selection_prompt", + "eval.tests.test_prompts_edges.test_empty_users_prints_no_users_and_skips_tui[delete]", + "eval.tests.test_prompts_edges.test_empty_users_prints_no_users_and_skips_tui[modify]", + "eval.tests.test_prompts_edges.test_empty_users_prints_no_users_and_skips_tui[reset]", + "eval.tests.test_prompts_edges.test_empty_users_prints_no_users_and_skips_tui[select]", + "eval.tests.test_prompts_edges.test_malformed_config_json_reports_read_error", + "eval.tests.test_prompts_init_and_extras.test_add_allows_users_differing_in_one_field[Other-a@example.com-ob]", + "eval.tests.test_prompts_init_and_extras.test_add_allows_users_differing_in_one_field[Seed-other@example.com-sb]", + "eval.tests.test_prompts_init_and_extras.test_init_by_alias_applies_local_config", + "eval.tests.test_prompts_init_and_extras.test_init_global_alias_outside_worktree", + "eval.tests.test_prompts_init_and_extras.test_init_gpg_alias_sets_signingkey", + "eval.tests.test_prompts_init_and_extras.test_init_local_outside_worktree_errors", + "eval.tests.test_prompts_init_and_extras.test_init_no_alias_selects_default_user", + "eval.tests.test_prompts_init_and_extras.test_init_no_alias_without_default_errors", + "eval.tests.test_prompts_init_and_extras.test_init_subcommand_alias_i_dispatches", + "eval.tests.test_prompts_init_and_extras.test_init_unknown_alias_errors", + "eval.tests.test_prompts_init_and_extras.test_root_select_user_idx0_applies_git_config", + "eval.tests.test_prompts_init_and_extras.test_root_select_user_no_config_errors", + "eval.tests.test_prompts_init_and_extras.test_root_select_user_no_users_prints_no_users", + "eval.tests.test_prompts_init_and_extras.test_selection_active_row_shows_marker_and_color", + "eval.tests.test_prompts_init_and_extras.test_selection_inactive_rows_omit_active_marker", + "eval.tests.test_prompts_select_git.test_select_global_works_outside_worktree", + "eval.tests.test_prompts_select_git.test_select_outside_worktree_errors", + "eval.tests.test_prompts_select_git.test_select_sets_local_git_config_in_worktree", + "eval.tests.test_prompts_selection.test_delete_arrow_down_selects_second", + "eval.tests.test_prompts_selection.test_delete_default_enter_selects_first", + "eval.tests.test_prompts_selection.test_deleting_last_remaining_user", + "eval.tests.test_prompts_selection.test_modify_selection_rename_name_field", + "eval.tests.test_prompts_selection.test_modify_updates_email_and_alias_preserving_gpg_key", + "eval.tests.test_prompts_selection.test_reset_no_keeps_profiles", + "eval.tests.test_prompts_selection.test_reset_yes_removes_all_profiles", + "eval.tests.test_prompts_selection.test_root_default_dispatch_to_add_new_user", + "eval.tests.test_prompts_selection.test_root_default_dispatch_to_delete_user", + "eval.tests.test_prompts_selection.test_select_shows_arrow_navigation_instruction", + "eval.tests.test_prompts_selection.test_selection_active_item_renders_arrow_marker", + "eval.tests.test_prompts_selection_deep.test_add_rejects_invalid_emails_and_reprompts[]", + "eval.tests.test_prompts_selection_deep.test_add_rejects_invalid_emails_and_reprompts[no-at-sign]", + "eval.tests.test_prompts_selection_deep.test_add_rejects_invalid_emails_and_reprompts[user@]", + "eval.tests.test_prompts_selection_deep.test_delete_alias_d_subcommand", + "eval.tests.test_prompts_selection_deep.test_delete_moves_back_up_to_first_of_three", + "eval.tests.test_prompts_selection_deep.test_delete_selection_arrow_boundary_clamps[\\x1b[A-Second]", + "eval.tests.test_prompts_selection_deep.test_delete_selection_arrow_boundary_clamps[\\x1b[B\\x1b[B-First]", + "eval.tests.test_prompts_selection_deep.test_modify_alias_only_preserves_name_and_email", + "eval.tests.test_prompts_selection_deep.test_modify_all_blank_keeps_record_unchanged", + "eval.tests.test_prompts_selection_deep.test_reset_confirmation_shows_profile_count_and_names", + "eval.tests.test_prompts_selection_deep.test_root_dispatch_to_modify_action", + "eval.tests.test_prompts_selection_deep.test_select_alias_s_subcommand_applies_profile", + "eval.tests.test_prompts_selection_deep.test_select_global_sets_signingkey_outside_worktree", + "eval.tests.test_prompts_selection_deep.test_select_local_sets_signingkey_for_gpg_user", + "eval.tests.test_prompts_selection_deep.test_select_without_gpg_unsets_signingkey" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_config_crud_add.test_add_accepts_duplicate_alias_when_alias_empty", + "eval.tests.test_config_crud_add.test_add_creates_config_and_appends_user", + "eval.tests.test_config_crud_add.test_add_duplicate_alias_rejects", + "eval.tests.test_config_crud_add.test_add_duplicate_name_and_email_rejects", + "eval.tests.test_config_crud_add.test_add_empty_alias_stores_empty_alias", + "eval.tests.test_config_crud_add.test_add_rejects_invalid_json_preexisting_store", + "eval.tests.test_config_crud_add.test_add_second_user_appends_to_existing_store", + "eval.tests.test_config_crud_add.test_add_with_gpg_stores_gpg_key", + "eval.tests.test_config_crud_add.test_add_write_fails_when_config_path_is_a_file", + "eval.tests.test_config_crud_delete.test_delete_first_of_two_swaps_last_into_place", + "eval.tests.test_config_crud_delete.test_delete_last_of_two_trims", + "eval.tests.test_config_crud_delete.test_delete_of_seeded_multi_user_store", + "eval.tests.test_config_crud_delete.test_delete_single_user_empties_store", + "eval.tests.test_config_crud_modify.test_modify_duplicate_alias_rejects", + "eval.tests.test_config_crud_modify.test_modify_no_change_keeps_modified_at", + "eval.tests.test_config_crud_modify.test_modify_partial_update_keeps_other_fields", + "eval.tests.test_config_crud_modify.test_modify_second_user_by_index", + "eval.tests.test_config_crud_modify.test_modify_updates_user_fields", + "eval.tests.test_config_crud_reset.test_reset_no_preserves_users", + "eval.tests.test_config_crud_reset.test_reset_yes_clears_all_users", + "eval.tests.test_config_crud_reset.test_reset_yes_clears_single_user", + "eval.tests.test_config_crud_select.test_select_global_writes_selected_profile_and_signingkey", + "eval.tests.test_config_crud_select.test_select_local_index_zero", + "eval.tests.test_config_crud_select.test_select_local_second_index", + "eval.tests.test_config_crud_select.test_select_local_second_user_keeps_first_db_untouched", + "eval.tests.test_config_empty.test_empty_user_store_no_users[delete]", + "eval.tests.test_config_empty.test_empty_user_store_no_users[init]", + "eval.tests.test_config_empty.test_empty_user_store_no_users[modify]", + "eval.tests.test_config_empty.test_empty_user_store_no_users[reset]", + "eval.tests.test_config_empty.test_empty_user_store_no_users[select]", + "eval.tests.test_config_empty.test_empty_user_store_with_null_users[delete]", + "eval.tests.test_config_empty.test_empty_user_store_with_null_users[init]", + "eval.tests.test_config_empty.test_empty_user_store_with_null_users[modify]", + "eval.tests.test_config_empty.test_empty_user_store_with_null_users[reset]", + "eval.tests.test_config_empty.test_empty_user_store_with_null_users[select]", + "eval.tests.test_config_empty.test_init_aliased_empty_store_no_users", + "eval.tests.test_config_empty.test_init_global_empty_store_no_users", + "eval.tests.test_config_init.test_init_global_alias_with_gpg_writes_signingkey", + "eval.tests.test_config_init.test_init_global_default_user", + "eval.tests.test_config_init.test_init_global_default_user_gpg_roundtrip", + "eval.tests.test_config_init.test_init_global_empty_alias_skips_gpg", + "eval.tests.test_config_init.test_init_global_no_default_user_errors", + "eval.tests.test_config_init.test_init_global_selects_by_alias", + "eval.tests.test_config_init.test_init_global_unknown_alias_errors", + "eval.tests.test_config_init.test_init_local_default_inside_worktree", + "eval.tests.test_config_init.test_init_local_inside_worktree_writes_local_config", + "eval.tests.test_config_init.test_init_local_outside_worktree_fails", + "eval.tests.test_config_path_addressability.test_config_json_occupied_by_directory_reported_missing[delete]", + "eval.tests.test_config_path_addressability.test_config_json_occupied_by_directory_reported_missing[init]", + "eval.tests.test_config_path_addressability.test_config_json_occupied_by_directory_reported_missing[modify]", + "eval.tests.test_config_path_addressability.test_config_json_occupied_by_directory_reported_missing[reset]", + "eval.tests.test_config_path_addressability.test_config_json_occupied_by_directory_reported_missing[select]", + "eval.tests.test_config_path_addressability.test_config_users_key_absent_is_empty_store[delete]", + "eval.tests.test_config_path_addressability.test_config_users_key_absent_is_empty_store[init]", + "eval.tests.test_config_path_addressability.test_config_users_key_absent_is_empty_store[modify]", + "eval.tests.test_config_path_addressability.test_config_users_key_absent_is_empty_store[reset]", + "eval.tests.test_config_path_addressability.test_config_users_key_absent_is_empty_store[select]", + "eval.tests.test_config_read_errors.test_config_err_precedes_git", + "eval.tests.test_config_read_errors.test_empty_config_file_reports_eof_error[delete]", + "eval.tests.test_config_read_errors.test_empty_config_file_reports_eof_error[init]", + "eval.tests.test_config_read_errors.test_empty_config_file_reports_eof_error[modify]", + "eval.tests.test_config_read_errors.test_empty_config_file_reports_eof_error[reset]", + "eval.tests.test_config_read_errors.test_empty_config_file_reports_eof_error[select]", + "eval.tests.test_config_read_errors.test_incomplete_json_reports_parse_error[delete]", + "eval.tests.test_config_read_errors.test_incomplete_json_reports_parse_error[init]", + "eval.tests.test_config_read_errors.test_incomplete_json_reports_parse_error[modify]", + "eval.tests.test_config_read_errors.test_incomplete_json_reports_parse_error[reset]", + "eval.tests.test_config_read_errors.test_incomplete_json_reports_parse_error[select]", + "eval.tests.test_config_read_errors.test_json_scalar_not_object", + "eval.tests.test_config_read_errors.test_json_wrong_field_type", + "eval.tests.test_config_read_errors.test_malformed_json_reports_parse_error[delete]", + "eval.tests.test_config_read_errors.test_malformed_json_reports_parse_error[init]", + "eval.tests.test_config_read_errors.test_malformed_json_reports_parse_error[modify]", + "eval.tests.test_config_read_errors.test_malformed_json_reports_parse_error[reset]", + "eval.tests.test_config_read_errors.test_malformed_json_reports_parse_error[select]", + "eval.tests.test_config_read_errors.test_missing_config_file_reports_error[delete]", + "eval.tests.test_config_read_errors.test_missing_config_file_reports_error[init]", + "eval.tests.test_config_read_errors.test_missing_config_file_reports_error[modify]", + "eval.tests.test_config_read_errors.test_missing_config_file_reports_error[reset]", + "eval.tests.test_config_read_errors.test_missing_config_file_reports_error[select]", + "eval.tests.test_config_read_errors.test_nested_object_still_error" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_add_email_validation.test_add_accepts_wellformed_email_and_persists[email-alice_at_example.com]", + "eval.tests.test_add_email_validation.test_add_accepts_wellformed_email_and_persists[email-first.last_at_example.com]", + "eval.tests.test_add_email_validation.test_add_accepts_wellformed_email_and_persists[email-x_at_example.com]", + "eval.tests.test_add_email_validation.test_add_blank_gpg_key_stores_empty", + "eval.tests.test_add_email_validation.test_add_empty_alias_defaults_no_bracket", + "eval.tests.test_add_email_validation.test_add_invalid_email_leaves_existing_config_unchanged", + "eval.tests.test_add_email_validation.test_add_rejects_malformed_email_without_persisting[email-EMPTY]", + "eval.tests.test_add_email_validation.test_add_rejects_malformed_email_without_persisting[email-_at_example.com]", + "eval.tests.test_add_email_validation.test_add_rejects_malformed_email_without_persisting[email-abc.example.com]", + "eval.tests.test_add_email_validation.test_add_rejects_malformed_email_without_persisting[email-not-an-email]", + "eval.tests.test_add_email_validation.test_add_sets_added_at_and_leaves_modified_at_zero", + "eval.tests.test_add_email_validation.test_add_two_users_preserves_both", + "eval.tests.test_add_email_validation.test_add_valid_after_rejected_email_retries", + "eval.tests.test_add_email_validation.test_add_with_gpg_flag_stores_key", + "eval.tests.test_init_git_config.test_init_author_can_change_email_only", + "eval.tests.test_init_git_config.test_init_default_user_banner", + "eval.tests.test_init_git_config.test_init_empty_config_prints_no_users", + "eval.tests.test_init_git_config.test_init_empty_config_with_alias_prints_no_users", + "eval.tests.test_init_git_config.test_init_global_bypasses_worktree_check", + "eval.tests.test_init_git_config.test_init_global_does_not_touch_local_config", + "eval.tests.test_init_git_config.test_init_global_with_gpg_sets_signingkey", + "eval.tests.test_init_git_config.test_init_global_writes_to_global_git_config[ALICE]", + "eval.tests.test_init_git_config.test_init_global_writes_to_global_git_config[BOB]", + "eval.tests.test_init_git_config.test_init_local_bare_repo_is_not_a_worktree", + "eval.tests.test_init_git_config.test_init_local_does_not_touch_global_config", + "eval.tests.test_init_git_config.test_init_local_inside_git_dir_is_not_a_worktree", + "eval.tests.test_init_git_config.test_init_local_outside_worktree_errors", + "eval.tests.test_init_git_config.test_init_local_with_gpg_sets_signingkey", + "eval.tests.test_init_git_config.test_init_local_without_gpg_unsets_signingkey", + "eval.tests.test_init_git_config.test_init_local_writes_name_and_email[ALICE]", + "eval.tests.test_init_git_config.test_init_local_writes_name_and_email[BOB]", + "eval.tests.test_init_git_config.test_init_local_writes_name_and_email[GEORGE]", + "eval.tests.test_init_git_config.test_init_no_default_user_errors", + "eval.tests.test_init_git_config.test_init_replaces_existing_local_identity", + "eval.tests.test_init_git_config.test_init_unknown_alias_errors", + "eval.tests.test_init_git_config.test_init_with_alias_formats_banner", + "eval.tests.test_select_modify_delete_reset.test_delete_empty_config_prints_no_users", + "eval.tests.test_select_modify_delete_reset.test_delete_removes_selected_user", + "eval.tests.test_select_modify_delete_reset.test_delete_second_user", + "eval.tests.test_select_modify_delete_reset.test_modify_all_empty_is_a_noop", + "eval.tests.test_select_modify_delete_reset.test_modify_email_keeps_existing_name", + "eval.tests.test_select_modify_delete_reset.test_modify_empty_alias_keeps_existing_alias", + "eval.tests.test_select_modify_delete_reset.test_modify_empty_config_prints_no_users", + "eval.tests.test_select_modify_delete_reset.test_modify_updates_alias_and_name_together", + "eval.tests.test_select_modify_delete_reset.test_modify_updates_single_nonempty_field[alias]", + "eval.tests.test_select_modify_delete_reset.test_modify_updates_single_nonempty_field[email]", + "eval.tests.test_select_modify_delete_reset.test_modify_updates_single_nonempty_field[name]", + "eval.tests.test_select_modify_delete_reset.test_reset_empty_config_prints_no_users", + "eval.tests.test_select_modify_delete_reset.test_reset_no_keeps_users", + "eval.tests.test_select_modify_delete_reset.test_reset_yes_clears_all_users", + "eval.tests.test_select_modify_delete_reset.test_select_empty_config_prints_no_users", + "eval.tests.test_select_modify_delete_reset.test_select_global_writes_global_config", + "eval.tests.test_select_modify_delete_reset.test_select_local_outside_worktree_errors", + "eval.tests.test_select_modify_delete_reset.test_select_noalias_user_formats_without_brackets", + "eval.tests.test_select_modify_delete_reset.test_select_second_user_via_down_arrow", + "eval.tests.test_select_modify_delete_reset.test_select_shows_user_menu_and_sets_local_config" + ] + } + }, + "commit": "72f9b67f120fe186e1124103249a9f41a68e3685", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.610234175334389, + "eval_clean_hashes": [ + "8dc7a2acda3e923c9a9afe2adea7f7795b4a8ad55da404d1d4c1b692a8253421" + ], + "input_record": { + "commit": "72f9b67f120fe186e1124103249a9f41a68e3685", + "commits": 61, + "contributors": 5, + "difficulty": "easy", + "difficulty_code_lines": 1019, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1019, + "difficulty_runtime_deps": 3, + "difficulty_score": 1.610234175334389, + "difficulty_test_code_lines": 0, + "full_name": "matsuyoshi30/gitsu", + "github_stars": 323, + "input_joern_zip": "go_joern/matsuyoshi30__gitsu.zip", + "joern_status": true, + "joern_time": 9.410470006987453, + "language": "go", + "pb_match": [ + { + "pb_fullname": "jesseduffield/lazygit", + "rank": 122, + "similarity": 0.592898428440094 + } + ], + "repo_age": 5.67, + "repo_path": "go/matsuyoshi30__gitsu", + "source": "commit:72f9b67f120fe186e1124103249a9f41a68e3685", + "status": "done", + "url": "https://github.com/matsuyoshi30/gitsu" + }, + "instance_id": "matsuyoshi30__gitsu.72f9b67", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 4, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + } + ], + "repository": "matsuyoshi30/gitsu" +} diff --git a/matsuyoshi30--gitsu.72f9b67/tests/test.sh b/matsuyoshi30--gitsu.72f9b67/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/matsuyoshi30--gitsu.72f9b67/tests/workspace.tar.gz b/matsuyoshi30--gitsu.72f9b67/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9180fc1d541484d81d5d0c43336f80715ed99bdc --- /dev/null +++ b/matsuyoshi30--gitsu.72f9b67/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e012a42ced39faaf7a0303aa33f3a4eeed1d706452771b1d4c9704fdf752d17b +size 1496110 diff --git a/mattes--go-asciibot.3fa6d76/environment/Dockerfile b/mattes--go-asciibot.3fa6d76/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5cf965202bf3f2bdbe7faab773b15c8629800597 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mattes--go-asciibot.3fa6d76/environment/download.sh b/mattes--go-asciibot.3fa6d76/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e9b9fe28e85c1025a203d22e725c6b2fcc98586 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mattes/go-asciibot + +go 1.10 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/mattes--go-asciibot.3fa6d76/environment/executable b/mattes--go-asciibot.3fa6d76/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..1ccf44ea6d1006e21497bc997f1cbe620321cc24 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c796dd50633bdb8727e996e17067829c787236c28c0de829b7d0366a58845a0 +size 2345289 diff --git a/mattes--go-asciibot.3fa6d76/environment/harbor_prepare_download_env.sh b/mattes--go-asciibot.3fa6d76/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattes--go-asciibot.3fa6d76/environment/programgym-go.tar.gz b/mattes--go-asciibot.3fa6d76/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mattes--go-asciibot.3fa6d76/environment/workspace.tar.gz b/mattes--go-asciibot.3fa6d76/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ca5ba26c8e3c826711866a04b75d71c21b5744fd --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db4b01f811647fa167d081b6bb6725404fab412a46f698cc7174b51e8fa8977b +size 2698 diff --git a/mattes--go-asciibot.3fa6d76/instruction.md b/mattes--go-asciibot.3fa6d76/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mattes--go-asciibot.3fa6d76/solution/solve.sh b/mattes--go-asciibot.3fa6d76/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mattes--go-asciibot.3fa6d76/task.toml b/mattes--go-asciibot.3fa6d76/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..103a3c2d500a4afa1fa7f86ecb62cc2e41b11adb --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mattes--go-asciibot.3fa6d76" +description = "Synthetic ProgramGym cleanroom reconstruction task for mattes/go-asciibot" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "mattes__go-asciibot.3fa6d76" +repository = "mattes/go-asciibot" +commit = "3fa6d766c4827187660a1bc723614dbff3f5ca00" +language = "go" +difficulty = "easy" +difficulty_score = 0.18184358794477262 +test_branches = 2 +test_count = 123 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mattes--go-asciibot.3fa6d76/tests/Dockerfile b/mattes--go-asciibot.3fa6d76/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18982f72e90272de65d43f035f12bce826cee126 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/Dockerfile @@ -0,0 +1,73 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_01.tar.gz b/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e65c187c08256ab599aa3cd02ddd58c128db68c6 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09c87c6d12c804fafd54c09e46bf14046637624be57f4f0eb403ad8b8958486e +size 7185 diff --git a/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_02.tar.gz b/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8da4589bbdbd0d863d86a86dad61e4b8616469c1 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bca2acae8997d774b70d72015d2ed7491e6cf3d10b5e4ddc6c1b72a8e6ec3cf +size 4598 diff --git a/mattes--go-asciibot.3fa6d76/tests/download.sh b/mattes--go-asciibot.3fa6d76/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e9b9fe28e85c1025a203d22e725c6b2fcc98586 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/download.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mattes/go-asciibot + +go 1.10 +PROGRAMGYM_GO_MOD_EOF +PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY="${GOPROXY:-direct}" +PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +case "$PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY" in + *"|"*|*","*) + PROGRAMGYM_INTERNAL_GO_FIRST_PROXY="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY%%[,|]*}" + PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER="${PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY#*[,|]}" + if [[ "$PROGRAMGYM_INTERNAL_GO_FIRST_PROXY" =~ [^[:space:]] ]] && [[ "$PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="${PROGRAMGYM_GO_PUBLIC_FALLBACK_PROXY:-${PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER}}" + fi + ;; +esac +if ! [[ "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" =~ [^[:space:]] ]]; then + PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY="" +fi +cat > /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py <<'PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF' +import os +import signal +import subprocess +import sys +import time + +sentinel_path, timeout_text, grace_text, proxy, *command = sys.argv[1:] +if not command: + raise SystemExit(125) +environment = os.environ.copy() +environment["GOPROXY"] = proxy +process = subprocess.Popen(command, env=environment, start_new_session=True) +try: + returncode = process.wait(timeout=float(timeout_text)) +except subprocess.TimeoutExpired: + with open(sentinel_path, "w", encoding="utf-8") as sentinel: + sentinel.write("expired\n") + try: + os.killpg(process.pid, signal.SIGTERM) + except ProcessLookupError: + pass + deadline = time.monotonic() + float(grace_text) + group_alive = True + while time.monotonic() < deadline: + process.poll() + try: + os.killpg(process.pid, 0) + except ProcessLookupError: + group_alive = False + break + time.sleep(0.05) + if group_alive: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + raise SystemExit(124) +if returncode < 0: + returncode = 128 - returncode +raise SystemExit(returncode) +PROGRAMGYM_GO_TIMEOUT_SUPERVISOR_EOF +PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS="${PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS:-90}" +if ! [[ "$PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS" =~ ^[1-9][0-9]*$ ]]; then + printf '%s\n' "download.sh: invalid PROGRAMGYM_GO_NEXUS_ATTEMPT_TIMEOUT_SECONDS=${PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS}" >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if ! command -v python3 >/dev/null 2>&1; then + printf '%s\n' 'download.sh: python3 is required for bounded Nexus Go downloads' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +_programgym_go_with_nexus_timeout() { + local programgym_go_rc + local programgym_go_timeout_sentinel + if ! programgym_go_timeout_sentinel="$(mktemp "${TMPDIR:-/tmp}/programgym-go-timeout.XXXXXX")"; then + return 1 + fi + 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 + programgym_go_rc=0 + else + programgym_go_rc=$? + fi + if [ ! -s "$programgym_go_timeout_sentinel" ]; then + rm -f "$programgym_go_timeout_sentinel" + return "$programgym_go_rc" + fi + rm -f "$programgym_go_timeout_sentinel" + if [ -z "$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" ]; then + 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 + return "$programgym_go_rc" + fi + 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 + env GOPROXY="$PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY" "$@" +} +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && _programgym_go_with_nexus_timeout env GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +# No external Go module dependencies to prefetch. +rm -f /workspace/.programgym_build_env/go-prefetch/.programgym_go_timeout_supervisor.py +unset -f _programgym_go_with_nexus_timeout +unset PROGRAMGYM_INTERNAL_GO_PRIMARY_PROXY +unset PROGRAMGYM_INTERNAL_GO_FALLBACK_PROXY +unset PROGRAMGYM_INTERNAL_GO_FIRST_PROXY +unset PROGRAMGYM_INTERNAL_GO_PROXY_REMAINDER +unset PROGRAMGYM_INTERNAL_GO_NEXUS_TIMEOUT_SECONDS diff --git a/mattes--go-asciibot.3fa6d76/tests/executable b/mattes--go-asciibot.3fa6d76/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..1ccf44ea6d1006e21497bc997f1cbe620321cc24 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c796dd50633bdb8727e996e17067829c787236c28c0de829b7d0366a58845a0 +size 2345289 diff --git a/mattes--go-asciibot.3fa6d76/tests/harbor_prepare_download_env.sh b/mattes--go-asciibot.3fa6d76/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattes--go-asciibot.3fa6d76/tests/programgym-go.tar.gz b/mattes--go-asciibot.3fa6d76/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mattes--go-asciibot.3fa6d76/tests/programgym_evaluator.py b/mattes--go-asciibot.3fa6d76/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mattes--go-asciibot.3fa6d76/tests/programgym_task.json b/mattes--go-asciibot.3fa6d76/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..a7eddcd61ace496fda1ff65d9076538347be5d9b --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/programgym_task.json @@ -0,0 +1,209 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot0]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot100]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot10]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot11]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot12]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot13]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot14]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot15]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot16]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot17]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot18]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot19]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot1]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot20]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot21]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot22]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot23]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot24]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot25]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot26]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot27]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot28]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot29]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot2]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot30]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot31]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot32]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot33]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot34]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot35]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot36]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot37]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot38]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot39]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot3]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot40]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot41]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot42]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot43]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot44]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot45]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot46]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot47]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot48]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot49]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot4]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot50]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot51]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot52]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot53]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot54]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot55]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot56]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot57]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot58]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot59]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot5]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot60]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot61]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot62]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot63]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot64]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot65]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot66]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot67]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot68]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot69]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot6]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot70]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot71]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot72]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot73]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot74]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot75]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot76]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot77]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot78]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot79]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot7]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot80]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot81]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot82]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot83]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot84]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot85]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot86]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot87]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot88]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot89]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot8]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot90]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot91]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot92]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot93]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot94]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot95]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot96]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot97]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot98]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot99]", + "eval.tests.test_bot_generation.test_each_bot_well_formed_bot_anatomy[bot9]", + "eval.tests.test_bot_generation.test_each_random_bot_followed_by_four_blank_lines", + "eval.tests.test_bot_generation.test_every_observed_eye_is_last_char_centered_eye_slot", + "eval.tests.test_bot_generation.test_every_observed_mouth_is_at_constant_column", + "eval.tests.test_bot_generation.test_executable_runs_to_completion_exit_zero", + "eval.tests.test_bot_generation.test_fixed_bot_eye_replacement_inserted_ooo", + "eval.tests.test_bot_generation.test_fixed_bot_matches_mustgenerate_13059_golden", + "eval.tests.test_bot_generation.test_fixed_bot_mouth_replacement_inserted_r", + "eval.tests.test_bot_generation.test_fixed_bot_split_body_boundaries", + "eval.tests.test_bot_generation.test_output_contains_expected_number_of_bots", + "eval.tests.test_bot_generation.test_random_bots_are_not_all_identical", + "eval.tests.test_bot_generation.test_random_bots_differ_from_fixed_bot" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_asciibot.test_arguments_are_ignored_and_full_sequence_still_prints", + "eval.tests.test_asciibot.test_each_random_bot_is_seven_nonempty_ascii_lines", + "eval.tests.test_asciibot.test_exactly_one_hundred_random_bot_blocks", + "eval.tests.test_asciibot.test_first_random_bot_is_a_bot_not_same_as_fixed", + "eval.tests.test_asciibot.test_fixed_bot_seed_looks_like_five_hex_characters", + "eval.tests.test_asciibot.test_no_stdin_needed_to_produce_full_output", + "eval.tests.test_asciibot.test_process_exits_zero_without_stderr", + "eval.tests.test_asciibot.test_random_bot_rendering_structure_marks_seed_is_hex", + "eval.tests.test_asciibot.test_random_bots_vary_across_the_sequence", + "eval.tests.test_asciibot.test_stdout_first_bot_is_exact_deterministic_bot", + "eval.tests.test_asciibot.test_stdout_total_line_count" + ] + } + }, + "commit": "3fa6d766c4827187660a1bc723614dbff3f5ca00", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 0.18184358794477262, + "eval_clean_hashes": [ + "7c796dd50633bdb8727e996e17067829c787236c28c0de829b7d0366a58845a0" + ], + "input_record": { + "commit": "3fa6d766c4827187660a1bc723614dbff3f5ca00", + "commits": 7, + "contributors": 2, + "difficulty": "easy", + "difficulty_code_lines": 152, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 152, + "difficulty_runtime_deps": 0, + "difficulty_score": 0.18184358794477262, + "difficulty_test_code_lines": 15, + "full_name": "mattes/go-asciibot", + "github_stars": 244, + "input_joern_zip": "go_joern/mattes__go-asciibot.zip", + "joern_status": true, + "joern_time": 6.827292003901675, + "language": "go", + "pb_match": [ + { + "pb_fullname": "sheepla/pingu", + "rank": 207, + "similarity": 0.5218114852905273 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 321, + "similarity": 0.5329835414886475 + }, + { + "pb_fullname": "TheZoraiz/ascii-image-converter", + "rank": 15, + "similarity": 0.6131944060325623 + } + ], + "repo_age": 7.4, + "repo_path": "go/mattes__go-asciibot", + "source": "commit:3fa6d766c4827187660a1bc723614dbff3f5ca00", + "status": "done", + "url": "https://github.com/mattes/go-asciibot" + }, + "instance_id": "mattes__go-asciibot.3fa6d76", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 3, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + } + ], + "repository": "mattes/go-asciibot" +} diff --git a/mattes--go-asciibot.3fa6d76/tests/test.sh b/mattes--go-asciibot.3fa6d76/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mattes--go-asciibot.3fa6d76/tests/workspace.tar.gz b/mattes--go-asciibot.3fa6d76/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ca5ba26c8e3c826711866a04b75d71c21b5744fd --- /dev/null +++ b/mattes--go-asciibot.3fa6d76/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db4b01f811647fa167d081b6bb6725404fab412a46f698cc7174b51e8fa8977b +size 2698 diff --git a/mattgathu--duma.6e06e9a/environment/Dockerfile b/mattgathu--duma.6e06e9a/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fcda33d89c241f216a19bcd9780cea160ab7d8c3 --- /dev/null +++ b/mattgathu--duma.6e06e9a/environment/Dockerfile @@ -0,0 +1,59 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mattgathu--duma.6e06e9a/environment/download.sh b/mattgathu--duma.6e06e9a/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c09795e61fd150b7f99886f0bd759e876e9ed935 --- /dev/null +++ b/mattgathu--duma.6e06e9a/environment/download.sh @@ -0,0 +1,2325 @@ +#!/usr/bin/env bash +# +# download.sh - ProgramGym networked download stage for mattgathu/duma. +# +# Standalone and source-safe: it is invoked via `source /source_ro/download.sh`, +# NOT `bash download.sh`. It only prefetches the full Cargo dependency graph +# (normal + dev dependencies) into $CARGO_HOME and installs the native OpenSSL +# headers that the offline build needs. It does not compile, link, test, or +# build the project. +# +# Because this script must not read any repository file (Cargo.toml/Cargo.lock +# are not present in the /source_ro mount during the download stage), the Cargo +# manifest and the canonical v4 lockfile are generated from inline data below. +# The generated manifest mirrors the repository's Cargo.toml verbatim +# (including [dev-dependencies]) so that `cargo fetch --locked` caches the exact +# dependency set the offline `cargo build --offline --locked` resolves. Ancillary +# stub source files are generated only so the temporary package root is valid. + +set -u + +# ---- native dependency required by reqwest -> native-tls -> openssl-sys ------- +# The offline build of openssl-sys needs OpenSSL development headers and +# pkg-config metadata. Ensure the dev package is present; if apt already +# satisfies this it is a no-op. +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y libssl-dev pkg-config + +# ---- generate a temporary cargo manifest + canonical v4 lockfile ------------- +# Mirrors package `duma` 0.2.0 (edition 2018) with the same dependency specs as +# the repository's Cargo.toml, so `--locked` resolves to the exact pinned graph. +DLOAD_TMP="${DLOAD_TMP:-$(mktemp -d)}" +mkdir -p "${DLOAD_TMP}/src" +GENERATED_MANIFEST="${DLOAD_TMP}/Cargo.toml" +GENERATED_LOCKFILE="${DLOAD_TMP}/Cargo.lock" + +cat > "${GENERATED_MANIFEST}" <<'MANIFEST_EOF' +[package] +name = "duma" +version = "0.2.0" +edition = "2018" + +[dependencies] +indicatif = "0.15.0" +console = "0.13.0" +clap = "2.33.2" +ftp = "3.0.1" +threadpool = "1.8.1" +failure = { version = "0.1.8", features = [] } +url = "1.7.2" +reqwest = {version = "0.10.8", features = ["blocking"]} + +[dev-dependencies] +assert_cmd = "0.11" +tiny_http = "0.6.2" +assert_fs = "0.11" +predicates = "1.0" +MANIFEST_EOF + +# Stub source files so the generated package root (lib + bin layout) is valid. +if [ ! -f "${DLOAD_TMP}/src/lib.rs" ]; then + printf '' > "${DLOAD_TMP}/src/lib.rs" +fi +if [ ! -f "${DLOAD_TMP}/src/main.rs" ]; then + printf 'fn main() {}\n' > "${DLOAD_TMP}/src/main.rs" +fi + +# Canonical v4 dependency graph (the exact resolution the offline build uses, +# reproduced verbatim including all dev-dependencies). Passed to --locked below. +cat > "${GENERATED_LOCKFILE}" <<'LOCK_EOF' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +dependencies = [ + "memchr 0.1.11", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr 2.8.3", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "ascii" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" + +[[package]] +name = "assert_cmd" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc477793bd82ec39799b6f6b3df64938532fdf2ab0d49ef817eac65856a5a1e" +dependencies = [ + "escargot", + "predicates", + "predicates-core", + "predicates-tree", +] + +[[package]] +name = "assert_fs" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ce6ba957da497523c08f8e0bd0f2e038d23ad6a3f7a391ed9d4afa9314838c0" +dependencies = [ + "globwalk", + "predicates", + "predicates-core", + "predicates-tree", + "tempfile", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if 1.0.4", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr 2.8.3", + "serde_core", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" +dependencies = [ + "num", + "time", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "chunked_transfer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim", + "textwrap", + "unicode-width 0.1.14", + "vec_map", +] + +[[package]] +name = "console" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a50aab2529019abfabfa93f1e6c41ef392f91fbf179b347a7e96abb524884a08" +dependencies = [ + "encode_unicode 0.3.6", + "lazy_static 1.5.0", + "libc", + "regex 1.13.1", + "terminal_size", + "unicode-width 0.1.14", + "winapi 0.3.9", + "winapi-util", +] + +[[package]] +name = "console" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" +dependencies = [ + "encode_unicode 1.0.0", + "libc", + "unicode-width 0.2.2", + "windows-sys", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "duma" +version = "0.2.0" +dependencies = [ + "assert_cmd", + "assert_fs", + "clap", + "console 0.13.0", + "failure", + "ftp", + "indicatif", + "predicates", + "reqwest", + "threadpool", + "tiny_http", + "url 1.7.2", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a7a45518d2863d18aa47f4a0cf9faec2aa4304cc09df5e41299f276b3ad135e" +dependencies = [ + "cfg-if 1.0.4", + "core_detect", + "multiversion", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "escargot" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597" +dependencies = [ + "lazy_static 1.5.0", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" + +[[package]] +name = "float-cmp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding 2.3.2", +] + +[[package]] +name = "ftp" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "542951aad0071952c27409e3bd7cb62d1a3ad419c4e7314106bf994e0083ad5d" +dependencies = [ + "chrono 0.2.25", + "lazy_static 0.1.16", + "regex 0.1.80", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags 1.3.2", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr 2.8.3", + "pin-project-lite 0.2.17", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if 1.0.4", + "libc", + "r-efi", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "globset" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" +dependencies = [ + "aho-corasick 1.1.5", + "bstr", + "log", + "regex-automata", + "regex-syntax 0.8.11", +] + +[[package]] +name = "globwalk" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89fa2e29859da05acd066bd45996f05c271b271d7ec4a781f909682328f65d25" +dependencies = [ + "ignore", + "walkdir", +] + +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", + "tracing-futures", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes 1.12.1", + "fnv", + "itoa 1.0.18", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "hyper" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 0.4.8", + "pin-project", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" +dependencies = [ + "bytes 0.5.6", + "hyper", + "native-tls", + "tokio", + "tokio-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b69833ed729dc5aa7d19541d96d6cf8e9137194207a04916d658e43168402f" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr 2.8.3", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console 0.16.4", + "lazy_static 1.5.0", + "number_prefix", + "regex 1.13.1", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" +dependencies = [ + "cfg-if 1.0.4", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "multiversion" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edb7f0ff51249dfda9ab96b5823695e15a052dc15074c9dbf3d118afaf2c201" +dependencies = [ + "multiversion-macros", + "target-features", +] + +[[package]] +name = "multiversion-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b093064383341eb3271f42e381cb8f10a01459478446953953c75d24bd339fc0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "target-features", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9bdb1fb680e609c2e0930c1866cafdd0be7e7c7a1ecf92aec71ed8d99d3e133" +dependencies = [ + "num-integer", + "num-iter", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi 0.5.3", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr 2.8.3", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags 2.13.1", + "cfg-if 1.0.4", + "foreign-types", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex 1.13.1", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "regex" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +dependencies = [ + "aho-corasick 0.5.3", + "memchr 0.1.11", + "regex-syntax 0.3.9", + "thread_local", + "utf8-ranges", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick 1.1.5", + "memchr 2.8.3", + "regex-automata", + "regex-syntax 0.8.11", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick 1.1.5", + "memchr 2.8.3", + "regex-syntax 0.8.11", +] + +[[package]] +name = "regex-syntax" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.10.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +dependencies = [ + "base64", + "bytes 0.5.6", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static 1.5.0", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding 2.3.2", + "pin-project-lite 0.2.17", + "serde", + "serde_urlencoded", + "tokio", + "tokio-tls", + "url 2.5.8", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.13.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa 1.0.18", + "memchr 2.8.3", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.18", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" + +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.4", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "target-features" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width 0.1.14", +] + +[[package]] +name = "thread-id" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +dependencies = [ + "kernel32-sys", + "libc", +] + +[[package]] +name = "thread_local" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +dependencies = [ + "thread-id", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi", + "winapi 0.3.9", +] + +[[package]] +name = "tiny_http" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e22cb179b63e5fc2d0b5be237dc107da072e2407809ac70a8ce85b93fe8f562" +dependencies = [ + "ascii", + "chrono 0.4.45", + "chunked_transfer", + "log", + "url 1.7.2", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf0ded5c4e56918d8f8a339e1bb67d038d3bc6d144ac407904015ba2e4cde9b" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static 1.5.0", + "memchr 2.8.3", + "mio", + "num_cpus", + "pin-project-lite 0.1.12", + "slab", +] + +[[package]] +name = "tokio-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.12", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite 0.2.17", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna 1.1.0", + "percent-encoding 2.3.2", + "serde", +] + +[[package]] +name = "utf8-ranges" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" +dependencies = [ + "cfg-if 1.0.4", + "once_cell", + "rustversion", + "serde", + "serde_json", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.5", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure 0.13.2", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure 0.13.2", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" +LOCK_EOF + +# ---- prefetch the full dependency graph into the cargo registry cache -------- +# Cargo writes its cache under $CARGO_HOME (default ~/.cargo). It is exported so +# that build.sh in the offline stage reuses the same populated cache. Fetch +# downloads only - it does not compile anything. --locked keeps the fetch pinned +# to the exact lock printed above, matching build.sh's offline resolution. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +if ! cargo fetch --locked --manifest-path "${GENERATED_MANIFEST}"; then + echo "download.sh: cargo fetch failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +echo "download.sh: Cargo dependency graph fetched and cached under ${CARGO_HOME}" diff --git a/mattgathu--duma.6e06e9a/environment/executable b/mattgathu--duma.6e06e9a/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..29a7238f13148f26fcb4ce2c3625f184a15d010d --- /dev/null +++ b/mattgathu--duma.6e06e9a/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1de08ef4fc449e59ab005d81b95213b12b2c3c0df43463985a88382128413fd5 +size 8340656 diff --git a/mattgathu--duma.6e06e9a/environment/harbor_prepare_download_env.sh b/mattgathu--duma.6e06e9a/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mattgathu--duma.6e06e9a/environment/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattgathu--duma.6e06e9a/environment/workspace.tar.gz b/mattgathu--duma.6e06e9a/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3dfee7061ce6ca67ad2a13c58bb31bef5a8a3145 --- /dev/null +++ b/mattgathu--duma.6e06e9a/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6d789eee1b68a2337b69af628f8d0ae0af07564f8740b74934f5ff96e4b86f0 +size 1903 diff --git a/mattgathu--duma.6e06e9a/instruction.md b/mattgathu--duma.6e06e9a/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mattgathu--duma.6e06e9a/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mattgathu--duma.6e06e9a/solution/solve.sh b/mattgathu--duma.6e06e9a/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mattgathu--duma.6e06e9a/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mattgathu--duma.6e06e9a/task.toml b/mattgathu--duma.6e06e9a/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d463588beff9f55e1cf69c4194576b569ea6b624 --- /dev/null +++ b/mattgathu--duma.6e06e9a/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mattgathu--duma.6e06e9a" +description = "Synthetic ProgramGym cleanroom reconstruction task for mattgathu/duma" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "rust"] + +[metadata] +source = "ProgramGym" +instance_id = "mattgathu__duma.6e06e9a" +repository = "mattgathu/duma" +commit = "6e06e9ac83ecb45db1da0fefcc2567ece56af804" +language = "rust" +difficulty = "easy" +difficulty_score = 1.9156636035057732 +test_branches = 5 +test_count = 196 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mattgathu--duma.6e06e9a/tests/Dockerfile b/mattgathu--duma.6e06e9a/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0134a64cf31409020689a99b234432f2b5f5f7fe --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM rust:1.97.1-bookworm +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV RUSTUP_TOOLCHAIN=1.97.1 +ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 +ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* +RUN rustup component add llvm-tools-preview --toolchain 1.97.1 +RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" +RUN rustc --version && cargo --version && rustup show active-toolchain +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /tmp/programgym-download.sh +RUN chmod 755 /tmp/programgym-download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /tmp/programgym-download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --break-system-packages \ + --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_01.tar.gz b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..24f07f8741bfc0ae50f6569a3d3b260aa7a96c9a --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c0dc61e52bba4ea73c333ae5a9c157a2c0f2d0d65e6f455d4c59a36beb3903 +size 13412 diff --git a/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_02.tar.gz b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f70a583aeb65c595d517846ad955bbe1734f726f --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0c81293a565a541dae6f85245d5708cb2fc79c0c14f63957a77571c120dbdd0 +size 5133 diff --git a/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_03.tar.gz b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f45dc1c4934298549c1de49b8c334e3af6adc5ec --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a987735f8607d240659f1f16c816cd30663b1c224d04704a15c1f8a2e8b3f1f9 +size 44066 diff --git a/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_04.tar.gz b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e2b026bce6cacfd978ab1b5ff5c326d4d5569944 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8064e94e9403b7a90aa63800a4b079caa3e41eff68a023ebc667f5c2d18d0358 +size 13073 diff --git a/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_upstream.tar.gz b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..331cf29568575df01f19af05625c195f2e8456ee --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:395ec9dc73f74f8f913c88e17914c05dce457868e8282b38278e0ef446ec46d2 +size 41356 diff --git a/mattgathu--duma.6e06e9a/tests/download.sh b/mattgathu--duma.6e06e9a/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c09795e61fd150b7f99886f0bd759e876e9ed935 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/download.sh @@ -0,0 +1,2325 @@ +#!/usr/bin/env bash +# +# download.sh - ProgramGym networked download stage for mattgathu/duma. +# +# Standalone and source-safe: it is invoked via `source /source_ro/download.sh`, +# NOT `bash download.sh`. It only prefetches the full Cargo dependency graph +# (normal + dev dependencies) into $CARGO_HOME and installs the native OpenSSL +# headers that the offline build needs. It does not compile, link, test, or +# build the project. +# +# Because this script must not read any repository file (Cargo.toml/Cargo.lock +# are not present in the /source_ro mount during the download stage), the Cargo +# manifest and the canonical v4 lockfile are generated from inline data below. +# The generated manifest mirrors the repository's Cargo.toml verbatim +# (including [dev-dependencies]) so that `cargo fetch --locked` caches the exact +# dependency set the offline `cargo build --offline --locked` resolves. Ancillary +# stub source files are generated only so the temporary package root is valid. + +set -u + +# ---- native dependency required by reqwest -> native-tls -> openssl-sys ------- +# The offline build of openssl-sys needs OpenSSL development headers and +# pkg-config metadata. Ensure the dev package is present; if apt already +# satisfies this it is a no-op. +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get install -y libssl-dev pkg-config + +# ---- generate a temporary cargo manifest + canonical v4 lockfile ------------- +# Mirrors package `duma` 0.2.0 (edition 2018) with the same dependency specs as +# the repository's Cargo.toml, so `--locked` resolves to the exact pinned graph. +DLOAD_TMP="${DLOAD_TMP:-$(mktemp -d)}" +mkdir -p "${DLOAD_TMP}/src" +GENERATED_MANIFEST="${DLOAD_TMP}/Cargo.toml" +GENERATED_LOCKFILE="${DLOAD_TMP}/Cargo.lock" + +cat > "${GENERATED_MANIFEST}" <<'MANIFEST_EOF' +[package] +name = "duma" +version = "0.2.0" +edition = "2018" + +[dependencies] +indicatif = "0.15.0" +console = "0.13.0" +clap = "2.33.2" +ftp = "3.0.1" +threadpool = "1.8.1" +failure = { version = "0.1.8", features = [] } +url = "1.7.2" +reqwest = {version = "0.10.8", features = ["blocking"]} + +[dev-dependencies] +assert_cmd = "0.11" +tiny_http = "0.6.2" +assert_fs = "0.11" +predicates = "1.0" +MANIFEST_EOF + +# Stub source files so the generated package root (lib + bin layout) is valid. +if [ ! -f "${DLOAD_TMP}/src/lib.rs" ]; then + printf '' > "${DLOAD_TMP}/src/lib.rs" +fi +if [ ! -f "${DLOAD_TMP}/src/main.rs" ]; then + printf 'fn main() {}\n' > "${DLOAD_TMP}/src/main.rs" +fi + +# Canonical v4 dependency graph (the exact resolution the offline build uses, +# reproduced verbatim including all dev-dependencies). Passed to --locked below. +cat > "${GENERATED_LOCKFILE}" <<'LOCK_EOF' +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aho-corasick" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +dependencies = [ + "memchr 0.1.11", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr 2.8.3", +] + +[[package]] +name = "android_system_properties" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "ascii" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" + +[[package]] +name = "assert_cmd" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc477793bd82ec39799b6f6b3df64938532fdf2ab0d49ef817eac65856a5a1e" +dependencies = [ + "escargot", + "predicates", + "predicates-core", + "predicates-tree", +] + +[[package]] +name = "assert_fs" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ce6ba957da497523c08f8e0bd0f2e038d23ad6a3f7a391ed9d4afa9314838c0" +dependencies = [ + "globwalk", + "predicates", + "predicates-core", + "predicates-tree", + "tempfile", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if 1.0.4", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr 2.8.3", + "serde_core", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" +dependencies = [ + "num", + "time", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "chunked_transfer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim", + "textwrap", + "unicode-width 0.1.14", + "vec_map", +] + +[[package]] +name = "console" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a50aab2529019abfabfa93f1e6c41ef392f91fbf179b347a7e96abb524884a08" +dependencies = [ + "encode_unicode 0.3.6", + "lazy_static 1.5.0", + "libc", + "regex 1.13.1", + "terminal_size", + "unicode-width 0.1.14", + "winapi 0.3.9", + "winapi-util", +] + +[[package]] +name = "console" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" +dependencies = [ + "encode_unicode 1.0.0", + "libc", + "unicode-width 0.2.2", + "windows-sys", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "duma" +version = "0.2.0" +dependencies = [ + "assert_cmd", + "assert_fs", + "clap", + "console 0.13.0", + "failure", + "ftp", + "indicatif", + "predicates", + "reqwest", + "threadpool", + "tiny_http", + "url 1.7.2", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a7a45518d2863d18aa47f4a0cf9faec2aa4304cc09df5e41299f276b3ad135e" +dependencies = [ + "cfg-if 1.0.4", + "core_detect", + "multiversion", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "escargot" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceb9adbf9874d5d028b5e4c5739d22b71988252b25c9c98fe7cf9738bee84597" +dependencies = [ + "lazy_static 1.5.0", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" + +[[package]] +name = "float-cmp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding 2.3.2", +] + +[[package]] +name = "ftp" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "542951aad0071952c27409e3bd7cb62d1a3ad419c4e7314106bf994e0083ad5d" +dependencies = [ + "chrono 0.2.25", + "lazy_static 0.1.16", + "regex 0.1.80", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags 1.3.2", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr 2.8.3", + "pin-project-lite 0.2.17", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if 1.0.4", + "libc", + "r-efi", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "globset" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" +dependencies = [ + "aho-corasick 1.1.5", + "bstr", + "log", + "regex-automata", + "regex-syntax 0.8.11", +] + +[[package]] +name = "globwalk" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89fa2e29859da05acd066bd45996f05c271b271d7ec4a781f909682328f65d25" +dependencies = [ + "ignore", + "walkdir", +] + +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", + "tracing-futures", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes 1.12.1", + "fnv", + "itoa 1.0.18", +] + +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "hyper" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 0.4.8", + "pin-project", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" +dependencies = [ + "bytes 0.5.6", + "hyper", + "native-tls", + "tokio", + "tokio-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b69833ed729dc5aa7d19541d96d6cf8e9137194207a04916d658e43168402f" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr 2.8.3", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "indicatif" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console 0.16.4", + "lazy_static 1.5.0", + "number_prefix", + "regex 1.13.1", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" +dependencies = [ + "cfg-if 1.0.4", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "multiversion" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edb7f0ff51249dfda9ab96b5823695e15a052dc15074c9dbf3d118afaf2c201" +dependencies = [ + "multiversion-macros", + "target-features", +] + +[[package]] +name = "multiversion-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b093064383341eb3271f42e381cb8f10a01459478446953953c75d24bd339fc0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "target-features", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9bdb1fb680e609c2e0930c1866cafdd0be7e7c7a1ecf92aec71ed8d99d3e133" +dependencies = [ + "num-integer", + "num-iter", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi 0.5.3", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr 2.8.3", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags 2.13.1", + "cfg-if 1.0.4", + "foreign-types", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex 1.13.1", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "regex" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +dependencies = [ + "aho-corasick 0.5.3", + "memchr 0.1.11", + "regex-syntax 0.3.9", + "thread_local", + "utf8-ranges", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick 1.1.5", + "memchr 2.8.3", + "regex-automata", + "regex-syntax 0.8.11", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick 1.1.5", + "memchr 2.8.3", + "regex-syntax 0.8.11", +] + +[[package]] +name = "regex-syntax" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.10.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +dependencies = [ + "base64", + "bytes 0.5.6", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static 1.5.0", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding 2.3.2", + "pin-project-lite 0.2.17", + "serde", + "serde_urlencoded", + "tokio", + "tokio-tls", + "url 2.5.8", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags 2.13.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa 1.0.18", + "memchr 2.8.3", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.18", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f" + +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.4", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "target-features" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width 0.1.14", +] + +[[package]] +name = "thread-id" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +dependencies = [ + "kernel32-sys", + "libc", +] + +[[package]] +name = "thread_local" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +dependencies = [ + "thread-id", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi", + "winapi 0.3.9", +] + +[[package]] +name = "tiny_http" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e22cb179b63e5fc2d0b5be237dc107da072e2407809ac70a8ce85b93fe8f562" +dependencies = [ + "ascii", + "chrono 0.4.45", + "chunked_transfer", + "log", + "url 1.7.2", +] + +[[package]] +name = "tinystr" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf0ded5c4e56918d8f8a339e1bb67d038d3bc6d144ac407904015ba2e4cde9b" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static 1.5.0", + "memchr 2.8.3", + "mio", + "num_cpus", + "pin-project-lite 0.1.12", + "slab", +] + +[[package]] +name = "tokio-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.12", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite 0.2.17", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna 1.1.0", + "percent-encoding 2.3.2", + "serde", +] + +[[package]] +name = "utf8-ranges" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" +dependencies = [ + "cfg-if 1.0.4", + "once_cell", + "rustversion", + "serde", + "serde_json", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.5", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure 0.13.2", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure 0.13.2", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" +LOCK_EOF + +# ---- prefetch the full dependency graph into the cargo registry cache -------- +# Cargo writes its cache under $CARGO_HOME (default ~/.cargo). It is exported so +# that build.sh in the offline stage reuses the same populated cache. Fetch +# downloads only - it does not compile anything. --locked keeps the fetch pinned +# to the exact lock printed above, matching build.sh's offline resolution. +export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" +if ! cargo fetch --locked --manifest-path "${GENERATED_MANIFEST}"; then + echo "download.sh: cargo fetch failed" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi + +echo "download.sh: Cargo dependency graph fetched and cached under ${CARGO_HOME}" diff --git a/mattgathu--duma.6e06e9a/tests/executable b/mattgathu--duma.6e06e9a/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..29a7238f13148f26fcb4ce2c3625f184a15d010d --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1de08ef4fc449e59ab005d81b95213b12b2c3c0df43463985a88382128413fd5 +size 8340656 diff --git a/mattgathu--duma.6e06e9a/tests/harbor_prepare_download_env.sh b/mattgathu--duma.6e06e9a/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a3a33381308d53b7bd2216a2375c8cd54ac24c4 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/harbor_prepare_download_env.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +command -v cargo +command -v rustc +command -v rustup +cd /workspace +set -a +source /tmp/programgym-download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattgathu--duma.6e06e9a/tests/programgym_evaluator.py b/mattgathu--duma.6e06e9a/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mattgathu--duma.6e06e9a/tests/programgym_task.json b/mattgathu--duma.6e06e9a/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..c5bc417e734f964f6c9271ca5e43a40121c579d8 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/programgym_task.json @@ -0,0 +1,1127 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli_ftp_dispatch.test_http_connection_refused_is_reported", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_ftp_dispatch.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli_url_scheme_dispatch.test_https_scheme_is_accepted_and_dispatches", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli_url_scheme_dispatch.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli_url_scheme_dispatch.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_cli_url_scheme_dispatch.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli_argument_errors.test_empty_string_url_rejected", + "eval.tests.test_cli_argument_errors.test_extra_positional_argument_is_rejected", + "eval.tests.test_cli_argument_errors.test_missing_required_url_fails", + "eval.tests.test_cli_argument_errors.test_missing_url_prints_usage_on_stderr", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[O-long]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[O-short]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[T-long]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[T-short]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[U-long]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[U-short]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[n-long]", + "eval.tests.test_cli_argument_errors.test_takes_value_option_missing_value_is_rejected[n-short]", + "eval.tests.test_cli_argument_errors.test_unknown_flag_is_rejected[long]", + "eval.tests.test_cli_argument_errors.test_unknown_flag_is_rejected[short]", + "eval.tests.test_cli_argument_errors.test_unknown_long_hyphenated_flag_rejected[near-miss-long]", + "eval.tests.test_cli_argument_errors.test_unknown_long_hyphenated_flag_rejected[unknown-long]", + "eval.tests.test_cli_filename_and_response.test_content_disposition_filename_wins_over_url_path", + "eval.tests.test_cli_filename_and_response.test_content_disposition_without_filename_falls_back_to_url_path", + "eval.tests.test_cli_filename_and_response.test_empty_content_type_renders_blank_type", + "eval.tests.test_cli_filename_and_response.test_nested_url_path_uses_last_segment", + "eval.tests.test_cli_filename_and_response.test_not_found_status_body_still_downloaded", + "eval.tests.test_cli_filename_and_response.test_octet_stream_content_type_reported", + "eval.tests.test_cli_filename_and_response.test_output_flag_overrides_content_disposition", + "eval.tests.test_cli_filename_and_response.test_percent_encoded_slash_yields_open_error", + "eval.tests.test_cli_filename_and_response.test_percent_encoded_url_path_decoded_in_filename", + "eval.tests.test_cli_filename_and_response.test_root_url_defaults_to_index_name", + "eval.tests.test_cli_filename_and_response.test_server_error_status_body_downloaded", + "eval.tests.test_cli_filename_and_response.test_url_path_without_extension_names_file", + "eval.tests.test_cli_filename_and_response.test_url_query_string_not_included_in_filename", + "eval.tests.test_cli_filename_and_response.test_various_percent_encoded_paths[encoded-dot]", + "eval.tests.test_cli_filename_and_response.test_various_percent_encoded_paths[encoded-percent]", + "eval.tests.test_cli_filename_and_response.test_various_percent_encoded_paths[spaces]", + "eval.tests.test_cli_flag_combinations.test_continue_and_quiet_combo", + "eval.tests.test_cli_flag_combinations.test_headers_flag_takes_precedence_over_download", + "eval.tests.test_cli_flag_combinations.test_many_flags_together_still_downloads", + "eval.tests.test_cli_flag_combinations.test_quiet_and_singlethread_combo", + "eval.tests.test_cli_flag_combinations.test_quiet_headers_combo_no_output", + "eval.tests.test_cli_flag_combinations.test_repeated_option_is_rejected", + "eval.tests.test_cli_flag_values.test_default_timeout_is_applied_silently", + "eval.tests.test_cli_flag_values.test_invalid_numeric_option_value_is_rejected[T-long]", + "eval.tests.test_cli_flag_values.test_invalid_numeric_option_value_is_rejected[T-short]", + "eval.tests.test_cli_flag_values.test_invalid_numeric_option_value_is_rejected[n-fraction]", + "eval.tests.test_cli_flag_values.test_invalid_numeric_option_value_is_rejected[n-word]", + "eval.tests.test_cli_flag_values.test_negative_value_is_parsed_as_flag_not_number", + "eval.tests.test_cli_flag_values.test_timeout_zero_causes_immediate_timeout", + "eval.tests.test_cli_flag_values.test_useragent_empty_value_falls_back", + "eval.tests.test_cli_flag_values.test_valid_timeout_seconds_value_accepted[five]", + "eval.tests.test_cli_flag_values.test_valid_timeout_seconds_value_accepted[one]", + "eval.tests.test_cli_flag_values.test_valid_timeout_seconds_value_accepted[two]", + "eval.tests.test_cli_ftp_dispatch.test_ftp_dispatch_attempts_connection_and_fails", + "eval.tests.test_cli_ftp_dispatch.test_ftp_to_closed_host_scheme_match_reached", + "eval.tests.test_cli_ftp_dispatch.test_ftp_with_credentials_dispatch", + "eval.tests.test_cli_ftp_dispatch.test_http_connection_refused_is_reported", + "eval.tests.test_cli_headers_flag.test_headers_flag_is_early_exit_without_writing_file", + "eval.tests.test_cli_headers_flag.test_headers_flag_requires_connection", + "eval.tests.test_cli_headers_flag.test_headers_flag_suppresses_progress_text", + "eval.tests.test_cli_headers_flag.test_headers_long_flag_matches_golden", + "eval.tests.test_cli_headers_flag.test_headers_prints_content_length", + "eval.tests.test_cli_headers_flag.test_headers_short_flag_prints_response_headers", + "eval.tests.test_cli_help_version.test_help_flag_ignores_missing_url", + "eval.tests.test_cli_help_version.test_help_long_flag_prints_full_usage", + "eval.tests.test_cli_help_version.test_help_short_flag_prints_full_usage", + "eval.tests.test_cli_help_version.test_version_flag_ignores_extra_url_argument", + "eval.tests.test_cli_help_version.test_version_flag_prints_crate_version[long]", + "eval.tests.test_cli_help_version.test_version_flag_prints_crate_version[short]", + "eval.tests.test_cli_http_download.test_content_disposition_filename_used_when_no_output_flag", + "eval.tests.test_cli_http_download.test_default_output_filename_from_url_path", + "eval.tests.test_cli_http_download.test_default_user_agent_is_duma_client", + "eval.tests.test_cli_http_download.test_download_preserves_varied_payloads[empty]", + "eval.tests.test_cli_http_download.test_download_preserves_varied_payloads[hello]", + "eval.tests.test_cli_http_download.test_download_preserves_varied_payloads[multi-chunk-128]", + "eval.tests.test_cli_http_download.test_download_preserves_varied_payloads[single-byte]", + "eval.tests.test_cli_http_download.test_download_writes_file_and_prints_length", + "eval.tests.test_cli_http_download.test_num_connections_variants[c16]", + "eval.tests.test_cli_http_download.test_num_connections_variants[c1]", + "eval.tests.test_cli_http_download.test_num_connections_variants[c2]", + "eval.tests.test_cli_http_download.test_num_connections_variants[c4]", + "eval.tests.test_cli_http_download.test_output_override_via_long_flag", + "eval.tests.test_cli_http_download.test_quiet_download_writes_file_with_no_output", + "eval.tests.test_cli_http_download.test_quiet_flag_suppresses_stdout_but_writes_file", + "eval.tests.test_cli_http_download.test_resume_flag_downloads_full_content", + "eval.tests.test_cli_http_download.test_singlethread_download_still_completes", + "eval.tests.test_cli_http_download.test_useragent_flag_sets_custom_agent", + "eval.tests.test_cli_response_and_output_paths.test_no_content_length_prints_skip_message", + "eval.tests.test_cli_response_and_output_paths.test_output_to_empty_string_errors", + "eval.tests.test_cli_response_and_output_paths.test_output_to_existing_directory_errors", + "eval.tests.test_cli_response_and_output_paths.test_output_to_nonexistent_directory_errors", + "eval.tests.test_cli_response_and_output_paths.test_resume_appends_and_sends_range_header[four-plus-three]", + "eval.tests.test_cli_response_and_output_paths.test_resume_appends_and_sends_range_header[six-plus-ten]", + "eval.tests.test_cli_url_scheme_dispatch.test_empty_host_fails_parse", + "eval.tests.test_cli_url_scheme_dispatch.test_empty_scheme_completed_as_http", + "eval.tests.test_cli_url_scheme_dispatch.test_https_scheme_is_accepted_and_dispatches", + "eval.tests.test_cli_url_scheme_dispatch.test_relative_path_completed_as_http", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[data]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[file]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[gopher]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[mailto]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[ssh]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[ws]", + "eval.tests.test_cli_url_scheme_dispatch.test_unsupported_scheme_is_rejected[wss]" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli.test_connection_refused_download", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_help_output", + "reasons": [ + { + "detail": "AssertionError: assert 'duma [FLAGS] [OPTIONS] ' in 'Duma 0.2.0\\nMatt Gathu \\nA minimal file downloader\\n\\nUSAGE:\\n executable [FLAGS] [OPTIONS] <... -T, --timeout ", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_help_short_flag", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_continue_on_hang_is_bounded_error", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_cli.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_num_connections", + "reasons": [ + { + "detail": "AttributeError: '_ThreadingHTTPServer' object has no attribute 'base'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_timeout", + "reasons": [ + { + "detail": "AttributeError: '_ThreadingHTTPServer' object has no attribute 'base'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_cli.test_missing_url_is_error", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_cli.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_negative_num_connections", + "reasons": [ + { + "detail": "AttributeError: '_ThreadingHTTPServer' object has no attribute 'base'", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_relative_url_prefixed_to_http", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_version_output", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_version_short_option", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli.test_connection_refused_download", + "eval.tests.test_cli.test_help_output", + "eval.tests.test_cli.test_help_short_flag", + "eval.tests.test_cli.test_invalid_continue_on_hang_is_bounded_error", + "eval.tests.test_cli.test_invalid_num_connections", + "eval.tests.test_cli.test_invalid_timeout", + "eval.tests.test_cli.test_missing_url_is_error", + "eval.tests.test_cli.test_negative_num_connections", + "eval.tests.test_cli.test_relative_url_prefixed_to_http", + "eval.tests.test_cli.test_unknown_flag_is_error", + "eval.tests.test_cli.test_unsupported_scheme_data", + "eval.tests.test_cli.test_unsupported_scheme_error", + "eval.tests.test_cli.test_version_output", + "eval.tests.test_cli.test_version_short_option" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_cli.test_help_flag_shows_usage", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_invalid_num_connections_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_long_version_flag", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_missing_required_url_is_an_error", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_cli.test_short_help_flag_shows_flags", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_cli.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_ftp_download.test_ftp_binary_file", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_ftp_download.test_ftp_connect_missing_file", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_ftp_download.test_ftp_green_text_size", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_ftp_download.test_ftp_root_text_download", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_ftp_download.test_ftp_subdirectory_download", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_ftp_download.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_headers_timeout.test_headers_flag_content_disposition_visible", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_headers_timeout.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_headers_timeout.test_slow_endpoint_times_out_concurrent", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_headers_timeout.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_concurrent.test_concurrent_exact_stdout", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_http_concurrent.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_concurrent.test_concurrent_small_file_golden_output", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_http_concurrent.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_concurrent.test_multiple_range_requests_observed", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_http_concurrent.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_http_concurrent.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_download.test_custom_useragent_sent", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_download.test_default_concurrent_requests_multiple_chunks", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_download.test_default_useragent_is_duma", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_download.test_medium_binary_exact_stdout", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_http_download.test_singlethread_small_download_exact_stdout", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_http_download.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_cli.test_help_flag_shows_usage", + "eval.tests.test_cli.test_invalid_num_connections_rejected", + "eval.tests.test_cli.test_invalid_timeout_rejected", + "eval.tests.test_cli.test_long_version_flag", + "eval.tests.test_cli.test_missing_required_url_is_an_error", + "eval.tests.test_cli.test_short_help_flag_shows_flags", + "eval.tests.test_cli.test_unknown_flag_is_rejected", + "eval.tests.test_cli.test_unsupported_url_scheme_is_errored", + "eval.tests.test_cli.test_version_flag_stdout", + "eval.tests.test_ftp_download.test_ftp_anonymous_login_default", + "eval.tests.test_ftp_download.test_ftp_big_file_in_subdir", + "eval.tests.test_ftp_download.test_ftp_binary_file", + "eval.tests.test_ftp_download.test_ftp_connect_missing_file", + "eval.tests.test_ftp_download.test_ftp_empty_file", + "eval.tests.test_ftp_download.test_ftp_green_text_size", + "eval.tests.test_ftp_download.test_ftp_multiple_fixtures_distinct", + "eval.tests.test_ftp_download.test_ftp_output_flag", + "eval.tests.test_ftp_download.test_ftp_quiet_mode", + "eval.tests.test_ftp_download.test_ftp_root_text_download", + "eval.tests.test_ftp_download.test_ftp_subdir_quiet", + "eval.tests.test_ftp_download.test_ftp_subdirectory_download", + "eval.tests.test_ftp_download.test_ftp_user_pass_login_used", + "eval.tests.test_ftp_download.test_ftp_user_without_pass_defaults_anonymous", + "eval.tests.test_headers_timeout.test_headers_flag_content_disposition_visible", + "eval.tests.test_headers_timeout.test_headers_flag_does_not_save_file", + "eval.tests.test_headers_timeout.test_headers_flag_larger_file_content_length", + "eval.tests.test_headers_timeout.test_headers_flag_lists_content_length", + "eval.tests.test_headers_timeout.test_headers_flag_quiet_still_prints_headers", + "eval.tests.test_headers_timeout.test_headers_flag_shows_accept_ranges", + "eval.tests.test_headers_timeout.test_slow_endpoint_times_out_concurrent", + "eval.tests.test_headers_timeout.test_slow_endpoint_times_out_singlethread", + "eval.tests.test_http_concurrent.test_concurrent_big_file_integrity", + "eval.tests.test_http_concurrent.test_concurrent_binary_dat", + "eval.tests.test_http_concurrent.test_concurrent_empty_file", + "eval.tests.test_http_concurrent.test_concurrent_exact_stdout", + "eval.tests.test_http_concurrent.test_concurrent_output_flag_overrides_content_disposition", + "eval.tests.test_http_concurrent.test_concurrent_small_file_golden_output", + "eval.tests.test_http_concurrent.test_custom_output_concurrent", + "eval.tests.test_http_concurrent.test_many_workers_concurrent_reassembly", + "eval.tests.test_http_concurrent.test_medium_concurrent_exact_recorded_sizes", + "eval.tests.test_http_concurrent.test_medium_concurrent_reassembly", + "eval.tests.test_http_concurrent.test_multiple_range_requests_observed", + "eval.tests.test_http_concurrent.test_num_connections_controls_worker_count", + "eval.tests.test_http_concurrent.test_single_worker_concurrent_reassembly", + "eval.tests.test_http_download.test_content_disposition_names_output", + "eval.tests.test_http_download.test_custom_useragent_sent", + "eval.tests.test_http_download.test_default_concurrent_requests_multiple_chunks", + "eval.tests.test_http_download.test_default_useragent_is_duma", + "eval.tests.test_http_download.test_empty_file_download", + "eval.tests.test_http_download.test_medium_binary_exact_stdout", + "eval.tests.test_http_download.test_no_accept_ranges_forces_singlethread", + "eval.tests.test_http_download.test_output_flag_renames_file", + "eval.tests.test_http_download.test_quiet_mode_concurrent_still_retrieves", + "eval.tests.test_http_download.test_quiet_mode_produces_no_output_still_downloads", + "eval.tests.test_http_download.test_range_request_made_for_resume", + "eval.tests.test_http_download.test_singlethread_small_download_exact_stdout", + "eval.tests.test_http_download.test_small_file_session_output", + "eval.tests.test_http_resume_errors.test_missing_resource_concurrent_empty", + "eval.tests.test_http_resume_errors.test_missing_resource_creates_empty_file", + "eval.tests.test_http_resume_errors.test_no_state_file_on_clean_concurrent", + "eval.tests.test_http_resume_errors.test_resume_complete_file_sends_range", + "eval.tests.test_http_resume_errors.test_resume_different_content_keeps_partial_bytes", + "eval.tests.test_http_resume_errors.test_resume_singlethread_partial_file" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_bar_progress.test_create_progress_bar_larger_file_length_line", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_bar_progress.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_bar_progress.test_create_progress_bar_length_line_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_bar_progress.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_bar_progress.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_download_behavior.test_download_behavior_flag_matrix[single-quiet]", + "reasons": [ + { + "detail": "AssertionError: Result(rc=1, stdout='', stderr=\"error: The argument '--quiet' was provided more than once, but cannot be used multiple times USAGE: executable --quiet --singlethread For more inf", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_download_behavior.test_headers_flag_reports_server_headers", + "reasons": [ + { + "id": "assertion_disjunction", + "message": "pytest assertion accepts alternatives with or", + "path": "eval/tests/test_download_behavior.py", + "repair_hint": "Assert one exact expected outcome instead of accepting alternative outcomes with or.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_download_behavior.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_download_behavior.test_stateful_download_then_resume_chain", + "reasons": [ + { + "detail": "AssertionError: assert 'Length: 37 (37B)' in 'Type: application/octet-stream\\nSaving to: big.dat\\nLength: 15 (15B)\\n' + where 'Type: application/octet-stream\\nSaving to: big.dat\\nLength: 15 (15B)\\n' =", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_download_behavior.test_stateful_singlethread_resume_appends", + "reasons": [ + { + "detail": "AssertionError: assert 6 >= 37 + where 6 = os.stat_result(st_mode=33188, st_ino=31225895, st_dev=2097350, st_nlink=1, st_uid=0, st_gid=0, st_size=6, st_atime=1788874404, st_mtime=1788874406, st_ctime=", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_utils_file_handle.test_get_file_handle_create_write_branch[singlethread-default]", + "reasons": [ + { + "detail": "AssertionError: assert 'Type: text/p...h: 20 (20B)\\n' == 'Type: text/p...h: 20 (20B)\\n' Type: text/plain - Saving to: single_out.txt ? ^^^^ ^^ -- + Saving to: hello.txt ? ^^ ^ Length: 20 (20B)", + "id": "gold_fail", + "message": "test failed against the reference executable", + "repair_hint": "Fix the expected observable behavior so the test passes against the reference executable.", + "severity": "error", + "stage": "gold_execution" + } + ] + }, + { + "name": "eval.tests.test_utils_parse_url.test_parse_url_missing_required_argument", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_utils_parse_url.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_bar_progress.test_create_progress_bar_larger_file_length_line", + "eval.tests.test_bar_progress.test_create_progress_bar_length_line_golden", + "eval.tests.test_bar_progress.test_create_progress_bar_not_used_when_headers_only", + "eval.tests.test_bar_progress.test_create_progress_bar_some_length[log]", + "eval.tests.test_bar_progress.test_create_progress_bar_some_length[text]", + "eval.tests.test_bar_progress.test_create_progress_bar_suppressed_in_quiet_mode", + "eval.tests.test_download_behavior.test_download_behavior_flag_matrix[conc-quiet]", + "eval.tests.test_download_behavior.test_download_behavior_flag_matrix[conc]", + "eval.tests.test_download_behavior.test_download_behavior_flag_matrix[single-quiet]", + "eval.tests.test_download_behavior.test_download_behavior_flag_matrix[single]", + "eval.tests.test_download_behavior.test_headers_flag_reports_server_headers", + "eval.tests.test_download_behavior.test_output_missing_parent_dir_fails_noent", + "eval.tests.test_download_behavior.test_output_writes_into_existing_subdirectory", + "eval.tests.test_download_behavior.test_stateful_download_then_resume_chain", + "eval.tests.test_download_behavior.test_stateful_singlethread_resume_appends", + "eval.tests.test_utils_file_handle.test_get_file_handle_create_write_branch[concurrent-default]", + "eval.tests.test_utils_file_handle.test_get_file_handle_create_write_branch[singlethread-default]", + "eval.tests.test_utils_file_handle.test_get_file_handle_error_is_a_directory[existing-dir]", + "eval.tests.test_utils_file_handle.test_get_file_handle_error_is_a_directory[subdir-output]", + "eval.tests.test_utils_file_handle.test_get_file_handle_resume_append_write_branch[resume-concurrent-append]", + "eval.tests.test_utils_file_handle.test_get_file_handle_resume_append_write_branch[resume-single-write]", + "eval.tests.test_utils_file_handle.test_get_file_handle_resume_when_no_local_file", + "eval.tests.test_utils_file_handle.test_get_file_handle_state_file_with_continue", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[data]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[file]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[git]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[gopher]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[mailto]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[rsync]", + "eval.tests.test_utils_parse_url.test_gen_error_unsupported_scheme[wget]", + "eval.tests.test_utils_parse_url.test_parse_url_explicit_http_scheme_is_accepted[dat]", + "eval.tests.test_utils_parse_url.test_parse_url_explicit_http_scheme_is_accepted[hello]", + "eval.tests.test_utils_parse_url.test_parse_url_explicit_http_scheme_is_accepted[nested]", + "eval.tests.test_utils_parse_url.test_parse_url_explicit_http_scheme_is_accepted[sub]", + "eval.tests.test_utils_parse_url.test_parse_url_malformed_absolute_url_fails[bad-ipv6]", + "eval.tests.test_utils_parse_url.test_parse_url_malformed_absolute_url_fails[bad-percent-domain]", + "eval.tests.test_utils_parse_url.test_parse_url_malformed_absolute_url_fails[bad-port]", + "eval.tests.test_utils_parse_url.test_parse_url_malformed_absolute_url_fails[empty-host]", + "eval.tests.test_utils_parse_url.test_parse_url_malformed_absolute_url_fails[space-domain]", + "eval.tests.test_utils_parse_url.test_parse_url_missing_required_argument", + "eval.tests.test_utils_parse_url.test_parse_url_relative_without_scheme_prepends_http[rel-other]", + "eval.tests.test_utils_parse_url.test_parse_url_relative_without_scheme_prepends_http[rel-plain]", + "eval.tests.test_utils_parse_url.test_parse_url_scheme_decision_ftp_vs_http", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_basic[dash]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_basic[dots]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_basic[percent-literal]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_basic[slash]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_basic[space]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_empty_path_uses_index_html", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_invalid_utf8_falls_back_to_raw", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_utf8_multibyte[euro]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_utf8_multibyte[utf8-lower]", + "eval.tests.test_utils_percent_decode.test_decode_percent_encoded_data_utf8_multibyte[utf8-upper]" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_client.test_call_without_url_rejected", + "eval.tests.test_client.test_content_disposition_selects_filename", + "eval.tests.test_client.test_download_writes_named_output_file", + "eval.tests.test_client.test_headers_flag_prints_server_headers", + "eval.tests.test_client.test_invalid_urls_rejected_with_specific_diagnostic[empty-host]", + "eval.tests.test_client.test_invalid_urls_rejected_with_specific_diagnostic[unsupported-scheme]", + "eval.tests.test_client.test_request_timeout" + ] + } + }, + "commit": "6e06e9ac83ecb45db1da0fefcc2567ece56af804", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.9156636035057732, + "eval_clean_hashes": [ + "1de08ef4fc449e59ab005d81b95213b12b2c3c0df43463985a88382128413fd5" + ], + "input_record": { + "codeql_db_mb": 84.04, + "codeql_status": true, + "codeql_time": 56.21796531882137, + "commit": "6e06e9ac83ecb45db1da0fefcc2567ece56af804", + "commits": 120, + "contributors": 4, + "difficulty": "easy", + "difficulty_code_lines": 915, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 915, + "difficulty_runtime_deps": 8, + "difficulty_score": 1.9156636035057732, + "difficulty_test_code_lines": 154, + "full_name": "mattgathu/duma", + "github_stars": 231, + "input_codeql_db": "rust_codeql/mattgathu__duma", + "language": "rs", + "pb_match": [ + { + "pb_fullname": "Drew-Alleman/DataSurgeon", + "rank": 500, + "similarity": 0.49912378191947937 + }, + { + "pb_fullname": "BurntSushi/ripgrep", + "rank": 792, + "similarity": 0.40242594480514526 + }, + { + "pb_fullname": "svenstaro/miniserve", + "rank": 84, + "similarity": 0.5690736770629883 + }, + { + "pb_fullname": "jhspetersson/fselect", + "rank": 451, + "similarity": 0.4545052647590637 + }, + { + "pb_fullname": "dalance/amber", + "rank": 954, + "similarity": 0.44938355684280396 + }, + { + "pb_fullname": "sstadick/hck", + "rank": 840, + "similarity": 0.423439621925354 + }, + { + "pb_fullname": "tarka/xcp", + "rank": 287, + "similarity": 0.47667765617370605 + }, + { + "pb_fullname": "Lymphatus/caesium-clt", + "rank": 659, + "similarity": 0.44726866483688354 + }, + { + "pb_fullname": "Isona/dirble", + "rank": 586, + "similarity": 0.4628884494304657 + }, + { + "pb_fullname": "ismaelgv/rnr", + "rank": 858, + "similarity": 0.39056071639060974 + }, + { + "pb_fullname": "riquito/tuc", + "rank": 436, + "similarity": 0.4411199688911438 + }, + { + "pb_fullname": "chmln/sd", + "rank": 442, + "similarity": 0.48390355706214905 + }, + { + "pb_fullname": "chmln/handlr", + "rank": 223, + "similarity": 0.5253700017929077 + }, + { + "pb_fullname": "mgdm/htmlq", + "rank": 411, + "similarity": 0.46703699231147766 + }, + { + "pb_fullname": "parcel-bundler/lightningcss", + "rank": 891, + "similarity": 0.445925772190094 + }, + { + "pb_fullname": "sharkdp/fd", + "rank": 309, + "similarity": 0.4662391245365143 + }, + { + "pb_fullname": "Byron/dua-cli", + "rank": 313, + "similarity": 0.47195032238960266 + }, + { + "pb_fullname": "Y2Z/monolith", + "rank": 338, + "similarity": 0.4902741611003876 + }, + { + "pb_fullname": "yaa110/nomino", + "rank": 769, + "similarity": 0.4320451617240906 + } + ], + "repo_age": 8.96, + "repo_path": "rust/mattgathu__duma", + "rust_channel": "stable", + "rust_edition": "2018", + "rust_release_date": "2018-12-06", + "rust_version": "1.31.0", + "rust_version_source": "edition", + "source": "commit:6e06e9ac83ecb45db1da0fefcc2567ece56af804", + "status": "done", + "url": "https://github.com/mattgathu/duma" + }, + "instance_id": "mattgathu__duma.6e06e9a", + "language": "rust", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 5, + "module_kind": "tests", + "termination_reason": "max_iterations" + } + ], + "repository": "mattgathu/duma" +} diff --git a/mattgathu--duma.6e06e9a/tests/test.sh b/mattgathu--duma.6e06e9a/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mattgathu--duma.6e06e9a/tests/workspace.tar.gz b/mattgathu--duma.6e06e9a/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3dfee7061ce6ca67ad2a13c58bb31bef5a8a3145 --- /dev/null +++ b/mattgathu--duma.6e06e9a/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6d789eee1b68a2337b69af628f8d0ae0af07564f8740b74934f5ff96e4b86f0 +size 1903 diff --git a/mattiamontanari--opengjk.2181131/environment/Dockerfile b/mattiamontanari--opengjk.2181131/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mattiamontanari--opengjk.2181131/environment/docker-compose.yaml b/mattiamontanari--opengjk.2181131/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mattiamontanari--opengjk.2181131/environment/download.sh b/mattiamontanari--opengjk.2181131/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..70354a3eed89c9ac400c1f23619929f47f007393 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/download.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym dependency-prefetch stage for MattiaMontanari/openGJK. +# +# This script ONLY prepares dependencies and environment for the offline build. +# It performs no compile/link/test/package/install step. +# +# The selected target (example_lib_opengjk_ce, the scalar C example) is built +# offline with only the base-image toolchain: gcc/g++ 13.3.0, cmake 3.31, make. +# No extra apt packages or external source archives are required for the +# scalar-only, non-SIMD build (BUILD_SIMD=OFF), so this stage primarily +# verifies the required tools are present and exports nothing the build needs +# beyond the already-configured PATH. +# +# This file is executed via `source /source_ro/download.sh`, so it must be +# source-safe: it exports environment variables into the current shell, takes no +# positional arguments, and never calls `exit` in its normal control flow. + +# Guard: fail cleanly if shell does not support set -euo pipefail colo. +set -eo pipefail + +# --------------------------------------------------------------------------- +# 1. Verify the required compilers and build tools are available. +# Every tool below is part of the Ubuntu 22.04 ProgramGym base image. +# Explicit availability checks (no error masking). +# --------------------------------------------------------------------------- +for tool in gcc g++ cmake make; do + if command -v "$tool" >/dev/null; then + printf 'download.sh: tool present: %s (%s)\n' "$tool" "$(command -v "$tool")" + else + printf 'download.sh: ERROR: required tool %q is missing from the base image\n' "$tool" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi + fi +done + +# --------------------------------------------------------------------------- +# 2. Persist tool availability facts as environment variables for build.sh. +# --------------------------------------------------------------------------- +export PROGRAMGYM_TOOLCHAIN_OK=1 +export PROGRAMGYM_OPENGL_SCALAR_ONLY=1 + +printf 'download.sh: dependency stage complete. Build toolchain is ready.\n' diff --git a/mattiamontanari--opengjk.2181131/environment/executable b/mattiamontanari--opengjk.2181131/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..ffdaa6cb924c6b87c4a04bdffdbdf4540f16085d Binary files /dev/null and b/mattiamontanari--opengjk.2181131/environment/executable differ diff --git a/mattiamontanari--opengjk.2181131/environment/harbor_configure_apt_mirror.sh b/mattiamontanari--opengjk.2181131/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mattiamontanari--opengjk.2181131/environment/harbor_prepare_download_env.sh b/mattiamontanari--opengjk.2181131/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattiamontanari--opengjk.2181131/environment/workspace.tar.gz b/mattiamontanari--opengjk.2181131/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2240961a51edc6ddc2b19418f0efdafb6c02edca --- /dev/null +++ b/mattiamontanari--opengjk.2181131/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1cc829c1097b861e723201d6516c4b0661018b2ca7710f611638c2376311678 +size 5938 diff --git a/mattiamontanari--opengjk.2181131/instruction.md b/mattiamontanari--opengjk.2181131/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mattiamontanari--opengjk.2181131/solution/solve.sh b/mattiamontanari--opengjk.2181131/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mattiamontanari--opengjk.2181131/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mattiamontanari--opengjk.2181131/task.toml b/mattiamontanari--opengjk.2181131/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..963aaa9e180626d3dee59b60072acf65a06dfa27 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mattiamontanari--opengjk.2181131" +description = "Synthetic ProgramGym cleanroom reconstruction task for MattiaMontanari/openGJK" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "MattiaMontanari__openGJK.2181131" +repository = "MattiaMontanari/openGJK" +commit = "2181131c3dc20ba924193152aa10db4e7f377de6" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.6487502126980194 +test_branches = 3 +test_count = 589 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mattiamontanari--opengjk.2181131/tests/Dockerfile b/mattiamontanari--opengjk.2181131/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_01.tar.gz b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1d219946c4eeef57a76108cd3e660b74a08b0abe --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cfe10fa90e5c0d48dc180817ebae71465d90aaea3f6f3b8fc5ea7ac4489aa80 +size 26943 diff --git a/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_02.tar.gz b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cfdc3ff2f23f0a91a4ac09f6c81a7a10487df876 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37ed718f562015b0222817bd27a781adc34883cb7b5d9204b91741e2a9c99b49 +size 28115 diff --git a/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_03.tar.gz b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b0547aa30823967cf61935de97f6046fc0c0219b --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3132258eddedf0fd602a22fb6b2f56669cef54e96cea40019e9d25baba330211 +size 20864 diff --git a/mattiamontanari--opengjk.2181131/tests/docker-compose.yaml b/mattiamontanari--opengjk.2181131/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mattiamontanari--opengjk.2181131/tests/download.sh b/mattiamontanari--opengjk.2181131/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..70354a3eed89c9ac400c1f23619929f47f007393 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/download.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# download.sh — ProgramGym dependency-prefetch stage for MattiaMontanari/openGJK. +# +# This script ONLY prepares dependencies and environment for the offline build. +# It performs no compile/link/test/package/install step. +# +# The selected target (example_lib_opengjk_ce, the scalar C example) is built +# offline with only the base-image toolchain: gcc/g++ 13.3.0, cmake 3.31, make. +# No extra apt packages or external source archives are required for the +# scalar-only, non-SIMD build (BUILD_SIMD=OFF), so this stage primarily +# verifies the required tools are present and exports nothing the build needs +# beyond the already-configured PATH. +# +# This file is executed via `source /source_ro/download.sh`, so it must be +# source-safe: it exports environment variables into the current shell, takes no +# positional arguments, and never calls `exit` in its normal control flow. + +# Guard: fail cleanly if shell does not support set -euo pipefail colo. +set -eo pipefail + +# --------------------------------------------------------------------------- +# 1. Verify the required compilers and build tools are available. +# Every tool below is part of the Ubuntu 22.04 ProgramGym base image. +# Explicit availability checks (no error masking). +# --------------------------------------------------------------------------- +for tool in gcc g++ cmake make; do + if command -v "$tool" >/dev/null; then + printf 'download.sh: tool present: %s (%s)\n' "$tool" "$(command -v "$tool")" + else + printf 'download.sh: ERROR: required tool %q is missing from the base image\n' "$tool" >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi + fi +done + +# --------------------------------------------------------------------------- +# 2. Persist tool availability facts as environment variables for build.sh. +# --------------------------------------------------------------------------- +export PROGRAMGYM_TOOLCHAIN_OK=1 +export PROGRAMGYM_OPENGL_SCALAR_ONLY=1 + +printf 'download.sh: dependency stage complete. Build toolchain is ready.\n' diff --git a/mattiamontanari--opengjk.2181131/tests/executable b/mattiamontanari--opengjk.2181131/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..ffdaa6cb924c6b87c4a04bdffdbdf4540f16085d Binary files /dev/null and b/mattiamontanari--opengjk.2181131/tests/executable differ diff --git a/mattiamontanari--opengjk.2181131/tests/harbor_configure_apt_mirror.sh b/mattiamontanari--opengjk.2181131/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mattiamontanari--opengjk.2181131/tests/harbor_prepare_download_env.sh b/mattiamontanari--opengjk.2181131/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattiamontanari--opengjk.2181131/tests/programgym_evaluator.py b/mattiamontanari--opengjk.2181131/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mattiamontanari--opengjk.2181131/tests/programgym_task.json b/mattiamontanari--opengjk.2181131/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..0635cca5cbf6a843e44b6a0adc864f4c74774b02 --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/programgym_task.json @@ -0,0 +1,918 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_deep_simplex_routes.test_cubes_diagonal_and_corner_gaps[p0-q0-3.4641016151377544]", + "eval.tests.test_deep_simplex_routes.test_cubes_diagonal_and_corner_gaps[p1-q1-0.7071067811865476]", + "eval.tests.test_deep_simplex_routes.test_cubes_diagonal_and_corner_gaps[p2-q2-0.7071067811865476]", + "eval.tests.test_deep_simplex_routes.test_hex_prisms_diagonal_z_touch[p0-q0-1.5]", + "eval.tests.test_deep_simplex_routes.test_hex_prisms_diagonal_z_touch[p1-q1-2.986616]", + "eval.tests.test_deep_simplex_routes.test_hex_prisms_diagonal_z_touch[p2-q2-0.0]", + "eval.tests.test_deep_simplex_routes.test_octahedron_touching_cube_face", + "eval.tests.test_deep_simplex_routes.test_parallel_rods_face_gaps[p0-q0-0.3]", + "eval.tests.test_deep_simplex_routes.test_parallel_rods_face_gaps[p1-q1-0.3]", + "eval.tests.test_deep_simplex_routes.test_parallel_rods_face_gaps[p2-q2-1.0]", + "eval.tests.test_deep_simplex_routes.test_point_deep_inside_cube_and_on_surface", + "eval.tests.test_deep_simplex_routes.test_point_on_cube_surface_reports_zero", + "eval.tests.test_deep_simplex_routes.test_point_vs_extended_body_gaps[point0-q0-0.5]", + "eval.tests.test_deep_simplex_routes.test_point_vs_extended_body_gaps[point1-q1-2.0]", + "eval.tests.test_deep_simplex_routes.test_prism_rod_pyramid_mixed_gaps[p0-q0-3.0]", + "eval.tests.test_deep_simplex_routes.test_prism_rod_pyramid_mixed_gaps[p1-q1-3.0]", + "eval.tests.test_deep_simplex_routes.test_prism_rod_pyramid_mixed_gaps[p2-q2-3.0]", + "eval.tests.test_deep_simplex_routes.test_prism_rod_pyramid_mixed_gaps[p3-q3-4.0]", + "eval.tests.test_deep_simplex_routes.test_pyramid_apex_to_point", + "eval.tests.test_deep_simplex_routes.test_rod_x_vs_rod_y_cross_touching", + "eval.tests.test_deep_simplex_routes.test_rod_x_vs_rod_z_cross_slant", + "eval.tests.test_deep_simplex_routes.test_slabs_and_thin_plates[p0-q0-0.5]", + "eval.tests.test_deep_simplex_routes.test_slabs_and_thin_plates[p1-q1-0.2]", + "eval.tests.test_deep_simplex_routes.test_slabs_and_thin_plates[p2-q2-2.0]", + "eval.tests.test_deep_simplex_routes.test_tetrahedron_vs_cube_face_gap", + "eval.tests.test_deep_simplex_routes.test_thin_box_corner_to_cube_diagonal", + "eval.tests.test_deep_simplex_routes.test_two_octahedra_diagonal_gap", + "eval.tests.test_deep_simplex_routes.test_two_octahedra_z_gap", + "eval.tests.test_deep_simplex_routes.test_two_tetrahedra_corner_gap", + "eval.tests.test_deep_simplex_routes.test_two_triangular_prisms_touch_along_edge", + "eval.tests.test_degenerate_points.test_collinear_segment_points", + "eval.tests.test_degenerate_points.test_flat_triangle_distance", + "eval.tests.test_degenerate_points.test_single_point_above_cube_face_z", + "eval.tests.test_degenerate_points.test_single_point_identical", + "eval.tests.test_degenerate_points.test_single_point_inside_cube_is_zero", + "eval.tests.test_degenerate_points.test_single_point_vs_cube_corner", + "eval.tests.test_degenerate_points.test_single_point_vs_cube_face", + "eval.tests.test_degenerate_points.test_two_segments_separated", + "eval.tests.test_degenerate_points.test_two_single_points_distance", + "eval.tests.test_distance_separated.test_flat_squares_diagonal_offset", + "eval.tests.test_distance_separated.test_flat_squares_separated_is_plane_distance", + "eval.tests.test_distance_separated.test_large_axis_gap_distance", + "eval.tests.test_distance_separated.test_negative_axis_separation", + "eval.tests.test_distance_separated.test_separated_distance_witness_consistency", + "eval.tests.test_distance_separated.test_separated_equal_sized_cubes[1.0-off_b0-2.0]", + "eval.tests.test_distance_separated.test_separated_equal_sized_cubes[1.0-off_b2-4.0]", + "eval.tests.test_distance_separated.test_separated_equal_sized_cubes[2.0-off_b1-2.0]", + "eval.tests.test_distance_separated.test_separated_equal_sized_cubes[3.0-off_b3-2.0]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(-2, -2, -2)-cube-(0.5, -2, -2)-cube-1.5]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(0, 0, 3.1)-cube-2.1]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(0, 2.25, 0)-cube-1.25]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(1.25, 1.25, 0)-cube-0.3535533905932738]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(1.5, 0, 0)-cube-0.5]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(1.5, 1.5, 1.5)-cube-0.8660254037844386]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(2.0, 0, 0)-cube-1.0]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(2.2, 1.2, 1.2)-cube-1.2328828005937953]", + "eval.tests.test_distance_separated.test_separated_unit_cubes_distance[cube-(0, 0, 0)-cube-(4.0, 0, 0)-cube-3.0]", + "eval.tests.test_geometry_diversity.test_box_negative_gap_on_minus_axis", + "eval.tests.test_geometry_diversity.test_cube_corner_to_far_point_diagonal", + "eval.tests.test_geometry_diversity.test_cube_diagonal_gap_isotropic", + "eval.tests.test_geometry_diversity.test_cube_shifted_all_axes_partial", + "eval.tests.test_geometry_diversity.test_octahedron_inner_vertex_count_differs_from_cube", + "eval.tests.test_geometry_diversity.test_octahedron_vs_cube_diagonal_corner", + "eval.tests.test_geometry_diversity.test_parallel_rods_stacked_in_z", + "eval.tests.test_geometry_diversity.test_pyramid_vs_cube_apex_approach", + "eval.tests.test_geometry_diversity.test_rectangular_box_gap_along_x", + "eval.tests.test_geometry_diversity.test_right_prism_diagonal_gap", + "eval.tests.test_geometry_diversity.test_right_prism_gap_along_x", + "eval.tests.test_geometry_diversity.test_same_tetrahedron_axis_shifts[shift0-0.0]", + "eval.tests.test_geometry_diversity.test_same_tetrahedron_axis_shifts[shift1-0.5]", + "eval.tests.test_geometry_diversity.test_same_tetrahedron_axis_shifts[shift2-2.0]", + "eval.tests.test_geometry_diversity.test_square_pyramid_gap_along_x", + "eval.tests.test_geometry_diversity.test_tetrahedron_crosses_cube", + "eval.tests.test_geometry_diversity.test_tetrahedron_diagonal_offset", + "eval.tests.test_geometry_diversity.test_tetrahedron_orthogonal_plane", + "eval.tests.test_geometry_diversity.test_thin_plate_above_flat_square_z_gap", + "eval.tests.test_geometry_diversity.test_two_octahedra_touching_along_x", + "eval.tests.test_geometry_diversity.test_two_parallel_rods_lateral_y_gap", + "eval.tests.test_geometry_diversity.test_unit_cube_vs_narrow_rod_varied_gap[1.5-0.5]", + "eval.tests.test_geometry_diversity.test_unit_cube_vs_narrow_rod_varied_gap[2.5-1.5]", + "eval.tests.test_geometry_diversity.test_unit_cube_vs_narrow_rod_varied_gap[3.5-2.5]", + "eval.tests.test_intersection_zero.test_cross_of_cubes_intersects", + "eval.tests.test_intersection_zero.test_cubes_overlapping_diagonally", + "eval.tests.test_intersection_zero.test_cubes_partially_overlapping", + "eval.tests.test_intersection_zero.test_cubes_touching_face_to_face", + "eval.tests.test_intersection_zero.test_flat_squares_overlapping", + "eval.tests.test_intersection_zero.test_flat_squares_touching_edge", + "eval.tests.test_intersection_zero.test_identical_cubes_overlap", + "eval.tests.test_intersection_zero.test_one_contained_in_other", + "eval.tests.test_intersection_zero.test_shared_vertex_peak", + "eval.tests.test_io_errors.test_both_operand_files_missing_reports_first", + "eval.tests.test_io_errors.test_invalid_vertex_count_never_prints_distance[-3\\n0 0 0\\n1 1 1\\n2 2 2\\n-negative declared vertex count]", + "eval.tests.test_io_errors.test_invalid_vertex_count_never_prints_distance[0\\n-zero vertices declared then coordinates follow in body data]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[1\\n1.0 2.0\\n]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[1\\nnot a number\\n]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[2\\n0 0 0\\n1 x 2\\n]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[2\\n0 0 0\\n]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[\\n\\n]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[]", + "eval.tests.test_io_errors.test_malformed_body_A_exits_nonzero[nope\\n]", + "eval.tests.test_io_errors.test_malformed_body_B_exits_nonzero", + "eval.tests.test_io_errors.test_missing_operand_file_named_in_error[userP.dat]", + "eval.tests.test_io_errors.test_missing_operand_file_named_in_error[userQ.dat]", + "eval.tests.test_io_errors.test_valid_input_exits_zero_and_prints_distance", + "eval.tests.test_polyhedra.test_distance_is_commutative[pv0-qv0]", + "eval.tests.test_polyhedra.test_distance_is_commutative[pv1-qv1]", + "eval.tests.test_polyhedra.test_distance_is_commutative[pv2-qv2]", + "eval.tests.test_polyhedra.test_distance_is_commutative[pv3-qv3]", + "eval.tests.test_polyhedra.test_large_many_vertex_body_reports_support_gap", + "eval.tests.test_polyhedra.test_octahedron_overlapping_cube", + "eval.tests.test_polyhedra.test_octahedron_touching_cube", + "eval.tests.test_polyhedra.test_octahedron_vs_cube_side_gap_is_x_support", + "eval.tests.test_polyhedra.test_octahedron_vs_separated_cube", + "eval.tests.test_polyhedra.test_right_tetrahedron_intersect_shift", + "eval.tests.test_polyhedra.test_right_tetrahedron_just_separated_shift", + "eval.tests.test_polyhedra.test_right_tetrahedron_offset_gap", + "eval.tests.test_polyhedra.test_run_is_repeatable_same_input", + "eval.tests.test_polyhedra_large.test_antisymmetric_polyhedra_witnesses", + "eval.tests.test_polyhedra_large.test_collinear_segment_against_cube_parallel", + "eval.tests.test_polyhedra_large.test_collinear_triple_vs_cube_diagonal", + "eval.tests.test_polyhedra_large.test_hex_prism_vs_cube_face_gap", + "eval.tests.test_polyhedra_large.test_large_box_far_offset_exact_gap", + "eval.tests.test_polyhedra_large.test_octahedron_vs_varied_bodies[qv0-1.0]", + "eval.tests.test_polyhedra_large.test_octahedron_vs_varied_bodies[qv1-2.0]", + "eval.tests.test_polyhedra_large.test_octahedron_vs_varied_bodies[qv2-2.1213203435596424]", + "eval.tests.test_polyhedra_large.test_tetrahedron_vs_opposite_tetrahedron_diagonal", + "eval.tests.test_polyhedra_large.test_thin_high_aspect_box_diagonal_witness", + "eval.tests.test_polyhedra_large.test_two_hex_prisms_separated_z", + "eval.tests.test_polyhedra_large.test_two_hex_prisms_touching_x", + "eval.tests.test_reference_data.test_polytope_duplicate_vertices", + "eval.tests.test_reference_data.test_polytope_opposite_vertex_count", + "eval.tests.test_reference_data.test_polytope_unbalanced_counts", + "eval.tests.test_reference_data.test_repo_sample_reference_distance", + "eval.tests.test_reference_data.test_repo_sample_witness_symmetry", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_commutative[x-45-1.2-1.0-1.0-1.0-0.521315]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_commutative[z-30-1.2-0.0-1.5-1.5-0.997844]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-15-0.8-1.5-1.5-1.5-0.945195]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-15-1.2-1.0-1.0-1.0-0.696589]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-15-1.2-1.5-1.5-1.5-1.72855]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-0.8-1.0-1.0-1.0-0.17735]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-0.8-1.5-1.5-1.5-0.870171]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-1.2-1.0-1.0-1.0-0.584488]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-1.2-1.5-1.5-1.5-1.605855]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-1.6-1.0-1.0-1.0-0.997535]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-1.6-1.5-1.5-1.5-2.351367]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-30-2.0-1.0-1.0-1.0-1.410582]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-45-0.8-1.0-1.0-1.0-0.155094]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-45-0.8-1.5-1.5-1.5-0.847914]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-45-1.2-1.0-1.0-1.0-0.521315]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-45-1.2-1.5-1.5-1.5-1.560545]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-45-2.0-1.0-1.0-1.0-1.292893]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-60-1.2-0.3-0.8-1.4-0.208291]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-60-1.6-0.3-0.8-1.4-0.47017]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-60-2.0-0.3-0.8-1.4-0.732051]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-75-1.6-0.3-0.8-1.4-0.60068]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[x-75-2.0-0.3-0.8-1.4-0.895187]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-30-0.8-0.0-1.5-1.5-0.424264]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-45-1.2-0.3-0.8-1.4-0.417021]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-45-1.6-0.0-1.5-1.5-1.604975]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-45-1.6-0.3-0.8-1.4-0.827704]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-45-2.0-0.0-1.5-1.5-2.210343]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-45-2.0-0.3-0.8-1.4-1.238753]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-60-1.2-0.3-0.8-1.4-0.473812]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-60-1.6-0.3-0.8-1.4-0.894641]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-60-2.0-0.3-0.8-1.4-1.31547]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-75-1.2-0.3-0.8-1.4-0.489238]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-75-1.6-0.3-0.8-1.4-0.88802]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[y-75-2.0-0.3-0.8-1.4-1.286801]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-15-1.2-0.3-0.8-1.4-0.445152]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-15-1.6-0.3-0.8-1.4-0.800708]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-15-2.0-0.3-0.8-1.4-1.156264]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-1.2-0.0-1.5-1.5-0.997844]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-1.2-0.3-0.8-1.4-0.424115]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-1.6-0.0-1.5-1.5-1.585859]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-1.6-0.3-0.8-1.4-0.783704]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-2.0-0.0-1.5-1.5-2.175328]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-30-2.0-0.3-0.8-1.4-1.143294]", + "eval.tests.test_rotated_octahedra_s3dcase0.test_rotated_octa_tetra_s3d_case0[z-75-1.2-0.3-0.8-1.4-0.36754]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_commutative[x-30-1.0-0.7-0.7-0.0-0.261861]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_commutative[y-60-1.0-0.6-1.2-0.6-0.750502]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_commutative[z-75-1.0-1.0-1.0-1.0-0.880903]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_overlap_reports_zero[x-15-0.8-0.3-0.3-0.3]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_overlap_reports_zero[x-15-1.0-0.0-0.0-0.0]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_overlap_reports_zero[x-30-0.8-0.5-0.5-0.0]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_overlap_reports_zero[x-30-1.2-0.0-0.0-0.0]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_overlap_reports_zero[y-45-0.8-0.3-0.3-0.3]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-105-0.6-0.5-0.0-1.5-0.138949]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-120-0.6-0.5-0.0-1.5-0.130931]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-15-0.6-0.6-0.8-1.4-0.392598]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-15-0.8-0.4-0.6-1.2-0.438786]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-15-0.8-0.7-0.7-0.0-0.08337]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-15-1.0-0.7-0.7-0.0-0.277899]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-150-0.6-0.5-0.0-1.5-0.089443]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-150-1.5-0.3-0.9-1.1-0.231496]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-0.6-0.5-0.0-1.5-0.050112]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-0.8-0.6-0.8-1.4-0.150229]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-0.8-1.0-1.0-1.0-0.267546]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.0-0.3-0.9-1.1-0.043448]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.0-0.6-0.8-1.4-0.332124]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.0-0.6-1.2-0.6-0.215979]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.2-0.3-0.9-1.1-0.167608]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.2-0.4-0.6-1.2-0.098326]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.2-0.6-0.8-1.4-0.514018]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.2-0.6-1.2-0.6-0.390106]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.5-0.3-0.9-1.1-0.353869]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.5-0.4-0.6-1.2-0.267245]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-165-1.5-0.6-0.8-1.4-0.78686]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-30-0.8-0.7-0.7-0.0-0.078558]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-30-1.0-0.7-0.7-0.0-0.261861]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-30-1.2-0.7-0.7-0.0-0.445164]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-30-1.5-0.7-0.7-0.0-0.720119]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-45-0.8-0.7-0.7-0.0-0.069282]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-45-1.0-0.7-0.7-0.0-0.23094]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-45-1.5-0.7-0.7-0.0-0.635085]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.6-0.4-0.6-1.2-0.109881]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.6-0.6-0.8-1.4-0.312354]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.6-0.6-1.2-0.6-0.127239]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.6-1.0-1.0-1.0-0.35771]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.8-0.4-0.6-1.2-0.364726]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.8-0.6-0.8-1.4-0.63469]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.8-0.6-1.2-0.6-0.362103]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-0.8-1.0-1.0-1.0-0.695164]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-1.0-0.5-0.5-0.5-0.188982]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-1.0-0.6-1.2-0.6-0.597109]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-1.0-0.7-0.7-0.0-0.068179]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-1.2-0.6-1.2-0.6-0.837506]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-60-1.5-0.6-1.2-0.6-1.205078]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-75-0.8-0.6-1.2-0.6-0.204563]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-75-1.0-0.6-1.2-0.6-0.400042]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-75-1.2-0.6-1.2-0.6-0.600488]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[x-75-1.5-0.6-1.2-0.6-0.910617]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-150-0.8-0.7-0.7-0.0-0.053666]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-165-1.5-0.8-0.6-0.6-0.175496]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-0.8-0.3-0.9-1.1-0.484974]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.0-0.3-0.9-1.1-0.750555]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.2-0.3-0.9-1.1-1.016137]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.2-0.4-0.6-1.2-0.946855]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.2-0.6-0.8-1.4-1.362547]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.5-0.3-0.9-1.1-1.414508]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.5-0.4-0.6-1.2-1.327906]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-45-1.5-0.6-0.8-1.4-1.847521]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.6-0.3-0.9-1.1-0.092598]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.6-0.4-0.6-1.2-0.057957]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.6-0.6-0.8-1.4-0.265803]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.8-0.3-0.9-1.1-0.315915]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.8-0.4-0.6-1.2-0.269727]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-0.8-0.6-0.8-1.4-0.546855]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.0-0.3-0.9-1.1-0.547489]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.0-0.4-0.6-1.2-0.481496]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.0-0.6-0.8-1.4-0.827906]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.2-0.3-0.9-1.1-0.786961]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.2-0.4-0.6-1.2-0.693265]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.2-0.6-0.8-1.4-1.108957]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.5-0.3-0.9-1.1-1.147364]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.5-0.4-0.6-1.2-1.015979]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-60-1.5-0.6-0.8-1.4-1.533881]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-0.6-0.6-0.8-1.4-0.147649]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-0.8-0.3-0.9-1.1-0.158375]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-0.8-0.4-0.6-1.2-0.112187]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-0.8-0.6-0.8-1.4-0.389315]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.0-0.3-0.9-1.1-0.351046]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.0-0.4-0.6-1.2-0.284572]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.0-0.6-0.8-1.4-0.630982]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.2-0.3-0.9-1.1-0.554592]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.2-0.4-0.6-1.2-0.456957]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.2-0.6-0.8-1.4-0.872649]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.5-0.4-0.6-1.2-0.719551]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-75-1.5-0.6-0.8-1.4-1.237481]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[y-90-1.0-0.3-0.9-1.1-0.173205]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-120-0.6-0.6-0.8-1.4-0.073422]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-60-0.6-0.3-0.9-1.1-0.198964]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-60-0.8-0.8-0.6-0.6-0.215711]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-60-1.0-0.8-0.6-0.6-0.433302]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-60-1.2-0.8-0.6-0.6-0.650894]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-60-1.5-0.8-0.6-0.6-0.97728]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-75-0.8-0.8-0.6-0.6-0.09135]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-75-1.0-0.8-0.6-0.6-0.287875]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-75-1.2-0.8-0.6-0.6-0.484399]", + "eval.tests.test_rotated_polytopes_s3d.test_rotated_tetra_s3d_face_region[z-75-1.5-0.8-0.6-0.6-0.779186]", + "eval.tests.test_s3d_subbranch_selectors.test_case0_dt2_select_1ik[cube-cube-p10-p20-0.077009-cube#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case0_dt2_select_1ik[cube-cube-p11-p21-0.208245-cube#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case0_dt2_select_1ik[cube-cube-p12-p22-0.077158-cube#3]", + "eval.tests.test_s3d_subbranch_selectors.test_case0_dt2_select_1k[cube-tetra-p10-p20-0.299019-cube#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case0_dt2_select_1k[cube-tetra-p11-p21-0.231512-cube#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1i[slab-slab-p10-p20-0.281407-slab#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1i[slab-slab-p11-p21-0.561233-slab#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1ik[rod-prism-p10-p20-0.242946-rod#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1ik[rod-prism-p11-p21-0.043655-rod#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1ik[rod-prism-p12-p22-0.129954-rod#3]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1j[octa-slab-p11-p21-0.22627-octa#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1j[tetra-rod-p10-p20-0.770518-tetra#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p10-p20-0.076616-slab#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p11-p21-0.199571-slab#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p110-p210-0.528967-slab#11]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p111-p211-0.056081-slab#12]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p12-p22-0.53766-slab#3]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p13-p23-0.065087-slab#4]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p14-p24-0.463088-slab#5]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p15-p25-0.327276-slab#6]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p16-p26-0.073393-slab#7]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p17-p27-0.3461-slab#8]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p18-p28-0.328848-slab#9]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt1_select_1jk[slab-cube-p19-p29-0.037822-slab#10]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p10-p20-0.664312-rod#1]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p11-p21-0.315954-rod#2]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p110-p210-0.553869-rod#11]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p12-p22-1.441386-rod#3]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p13-p23-0.403424-rod#4]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p14-p24-0.54419-rod#5]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p15-p25-1.016121-rod#6]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p16-p26-0.217481-rod#7]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p17-p27-0.063711-rod#8]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p18-p28-0.746476-rod#9]", + "eval.tests.test_s3d_subbranch_selectors.test_case1_dt2_select_1k[rod-octa-p19-p29-0.583837-rod#10]", + "eval.tests.test_s3d_subbranch_selectors.test_s3dregion1_dot_total_zero[rod-slab-p10-p20-0.320446-rod#1]", + "eval.tests.test_s3d_subbranch_selectors.test_s3dregion1_dot_total_zero[rod-slab-p11-p21-1.535503-rod#2]", + "eval.tests.test_s3d_subbranch_selectors.test_s3dregion1_dot_total_zero[rod-slab-p12-p22-0.791802-rod#3]", + "eval.tests.test_s3d_subbranch_selectors.test_s3dregion1_dot_total_zero[rod-slab-p13-p23-0.434647-rod#4]", + "eval.tests.test_witnesses.test_witness_consistency_touching_cubes", + "eval.tests.test_witnesses.test_witness_separation_equals_distance", + "eval.tests.test_witnesses.test_witnesses_cube_gap_are_face_centres", + "eval.tests.test_witnesses.test_witnesses_diagonal_cube", + "eval.tests.test_witnesses.test_witnesses_lie_on_respective_bodies", + "eval.tests.test_witnesses.test_witnesses_point_to_cube", + "eval.tests.test_witnesses.test_witnesses_single_point_pair" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_format_edges_extra.test_large_integer_point_gap_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_format_edges_extra.test_negative_dot_five_coordinate_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_format_edges_extra.test_positive_plus_dot_uppercase_E_coordinate_golden", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_format_edges_extra.test_uppercase_exponent_E_coordinate_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_format_edges_extra.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_cube_vs_body_diagonal_point_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_regular_hexagon_point_above_centroid_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_regular_pentagon_point_above_centroid_golden", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_segment_piercing_square_golden", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_square_pyramid_point_below_base_golden", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_triangle_point_above_centroid_golden", + "reasons": [ + { + "id": "sole_returncode", + "message": "pytest test only asserts returncode == 0", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Check stdout, stderr, generated files, or structured output in addition to exit code.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_geometry_families.test_triangle_point_closest_on_slanted_edge", + "reasons": [ + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_geometry_families.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_boundaries.test_collinear_segments_output_is_consistent", + "eval.tests.test_boundaries.test_distance_is_euclidean_norm_of_witness_difference", + "eval.tests.test_boundaries.test_extra_blank_lines_between_vertices", + "eval.tests.test_boundaries.test_leading_whitespace_before_vertex_count", + "eval.tests.test_boundaries.test_multiple_spaces_in_coordinate_row", + "eval.tests.test_boundaries.test_negative_vertex_body1_crashes", + "eval.tests.test_boundaries.test_negative_vertex_body2_crashes", + "eval.tests.test_boundaries.test_perpendicular_cross_segments", + "eval.tests.test_boundaries.test_separated_single_points_distance", + "eval.tests.test_boundaries.test_success_does_not_emit_anything_to_stderr", + "eval.tests.test_boundaries.test_two_identical_single_points_zero_distance", + "eval.tests.test_boundaries.test_witnesses_lie_within_body_bounding_boxes", + "eval.tests.test_boundaries.test_zero_vertex_body1_crashes", + "eval.tests.test_boundaries.test_zero_vertex_body2_crashes", + "eval.tests.test_boundaries.test_zero_vertex_both_bodies_crash", + "eval.tests.test_errors.test_alphabetic_vertex_count_silent_exit", + "eval.tests.test_errors.test_body1_partial_rows_fewer_than_declared_silent_exit", + "eval.tests.test_errors.test_declared_many_but_immediately_eof", + "eval.tests.test_errors.test_empty_body1_file_silent_exit", + "eval.tests.test_errors.test_empty_body2_file_silent_exit", + "eval.tests.test_errors.test_input_path_that_is_a_directory_fails_silently", + "eval.tests.test_errors.test_missing_body1_file_prints_error", + "eval.tests.test_errors.test_missing_body2_file_prints_error", + "eval.tests.test_errors.test_missing_both_files_reports_body1_first", + "eval.tests.test_errors.test_missing_file_error_goes_to_stdout_not_stderr", + "eval.tests.test_errors.test_missing_third_coordinate_silent_exit", + "eval.tests.test_errors.test_non_integer_vertex_count_silent_exit", + "eval.tests.test_errors.test_non_numeric_coordinate_silent_exit", + "eval.tests.test_errors.test_partial_rows_fewer_than_declared_silent_exit", + "eval.tests.test_errors.test_too_few_coordinates_in_row_silent_exit", + "eval.tests.test_errors.test_whitespace_only_body2_silent_exit", + "eval.tests.test_format_edges_extra.test_large_integer_negative_scale_distance", + "eval.tests.test_format_edges_extra.test_large_integer_point_gap_golden", + "eval.tests.test_format_edges_extra.test_negative_dot_five_coordinate_golden", + "eval.tests.test_format_edges_extra.test_positive_plus_dot_uppercase_E_coordinate_golden", + "eval.tests.test_format_edges_extra.test_uppercase_E_against_lowercase_e_point", + "eval.tests.test_format_edges_extra.test_uppercase_E_hexadecimal_interop", + "eval.tests.test_format_edges_extra.test_uppercase_exponent_E_coordinate_golden", + "eval.tests.test_format_edges_extra.test_uppercase_exponent_negative_coordinate", + "eval.tests.test_geometry_exact.test_corner_touching_squares_exact", + "eval.tests.test_geometry_exact.test_cube_edge_to_point_diagonal", + "eval.tests.test_geometry_exact.test_cubes_corner_to_corner_sqrt3", + "eval.tests.test_geometry_exact.test_grid_offset_four_gap", + "eval.tests.test_geometry_exact.test_identical_bodies_distance_zero", + "eval.tests.test_geometry_exact.test_large_offset_cube_pair_distance", + "eval.tests.test_geometry_exact.test_nested_bodies_contact", + "eval.tests.test_geometry_exact.test_overlapping_cubes_report_zero", + "eval.tests.test_geometry_exact.test_parallel_cubes_face_gap_exact", + "eval.tests.test_geometry_exact.test_parallel_segments_gap_exact", + "eval.tests.test_geometry_exact.test_point_inside_cube_reports_zero", + "eval.tests.test_geometry_exact.test_point_on_cube_face_gap", + "eval.tests.test_geometry_exact.test_pythagorean_pair_exact_witnesses", + "eval.tests.test_geometry_exact.test_skew_edges_3d_gap", + "eval.tests.test_geometry_exact.test_squares_z_gap_five_exact", + "eval.tests.test_geometry_exact.test_tetrahedron_point_gap", + "eval.tests.test_geometry_families.test_cube_vs_body_diagonal_point_golden", + "eval.tests.test_geometry_families.test_parallel_triangles_z_gap_one", + "eval.tests.test_geometry_families.test_regular_hexagon_point_above_centroid_golden", + "eval.tests.test_geometry_families.test_regular_hexagon_point_above_perpendicular_witnesses", + "eval.tests.test_geometry_families.test_regular_pentagon_point_above_centroid_golden", + "eval.tests.test_geometry_families.test_segment_piercing_square_golden", + "eval.tests.test_geometry_families.test_square_pyramid_point_below_base_golden", + "eval.tests.test_geometry_families.test_triangle_point_above_centroid_golden", + "eval.tests.test_geometry_families.test_triangle_point_closest_on_slanted_edge", + "eval.tests.test_geometry_families.test_triangle_point_perpendicular_witnesses", + "eval.tests.test_geometry_families.test_triangle_pythag_plane_point", + "eval.tests.test_geometry_families.test_triangle_vs_square_shared_edge_touch", + "eval.tests.test_geometry_families.test_triangles_sharing_edge_touch_golden", + "eval.tests.test_geometry_touch.test_coincident_single_points_report_zero", + "eval.tests.test_geometry_touch.test_cubes_near_touch_positive_gap", + "eval.tests.test_geometry_touch.test_cubes_sharing_face_report_zero", + "eval.tests.test_geometry_touch.test_point_at_cube_vertex_is_touch", + "eval.tests.test_geometry_touch.test_point_at_segment_endpoint_is_touch", + "eval.tests.test_geometry_touch.test_point_on_cube_surface_is_touch", + "eval.tests.test_numeric_formats.test_exponent_lowercase_e_coordinates", + "eval.tests.test_numeric_formats.test_hex_float_coordinate_parsed", + "eval.tests.test_numeric_formats.test_int_coordinates_multiple_precision_forms", + "eval.tests.test_numeric_formats.test_large_magnitude_coordinates", + "eval.tests.test_numeric_formats.test_large_vertex_count_scales", + "eval.tests.test_numeric_formats.test_leading_plus_and_dot_forms", + "eval.tests.test_numeric_formats.test_negative_and_mixed_sign_vertices", + "eval.tests.test_numeric_formats.test_zero_coordinates_and_origin_body", + "eval.tests.test_parse_edges.test_count_with_trailing_letters_reads_prefix", + "eval.tests.test_parse_edges.test_declared_count_shortfall_positive_exit", + "eval.tests.test_parse_edges.test_float_prefix_vertex_count_truncates", + "eval.tests.test_parse_edges.test_garbage_then_digits_in_count_fails", + "eval.tests.test_parse_edges.test_negative_zero_count_crashes", + "eval.tests.test_parse_edges.test_positive_signed_vertex_count_accepted", + "eval.tests.test_parse_edges.test_row_with_extra_numbers_uses_first_three", + "eval.tests.test_parse_edges.test_vertex_coordinates_split_across_lines", + "eval.tests.test_readinput_lexemes.test_fourth_numeric_token_on_row_ignored", + "eval.tests.test_readinput_lexemes.test_hex_float_negative_exponent_golden", + "eval.tests.test_readinput_lexemes.test_leading_plus_coordinate_golden", + "eval.tests.test_readinput_lexemes.test_letter_starting_next_row_fails_silently", + "eval.tests.test_readinput_lexemes.test_non_hex_trailing_letter_accepted", + "eval.tests.test_readinput_lexemes.test_tiny_positive_distance_formatted_golden", + "eval.tests.test_readinput_lexemes.test_zero_ex_garbage_hex_suffix_fails_silently", + "eval.tests.test_readinput_lexemes.test_zero_then_x_coordinate_fails_silently", + "eval.tests.test_special_values.test_count_with_exponent_truncates_then_shortfalls", + "eval.tests.test_special_values.test_count_zero_x_hex_truncates_to_zero_then_crashes", + "eval.tests.test_special_values.test_exponent_coordinate_5e1_golden", + "eval.tests.test_special_values.test_hex_coordinate_combines_with_plain_decimal", + "eval.tests.test_special_values.test_hex_integer_coordinate_0x10_golden", + "eval.tests.test_special_values.test_inf_coordinate_on_body1_golden", + "eval.tests.test_special_values.test_inf_coordinate_on_body2_golden", + "eval.tests.test_special_values.test_inf_on_both_yields_neg_nan_banner_golden", + "eval.tests.test_special_values.test_infinity_spelling_coordinate_accepted", + "eval.tests.test_special_values.test_nan_coordinate_triggers_max_iter_banner_golden", + "eval.tests.test_special_values.test_nan_in_z_coordinate_banner", + "eval.tests.test_special_values.test_neg_inf_coordinate_golden", + "eval.tests.test_special_values.test_neg_nan_coordinate_banner", + "eval.tests.test_special_values.test_parallel_segments_z_gap_four", + "eval.tests.test_special_values.test_segment_with_inf_endpoint_degenerates_to_point", + "eval.tests.test_special_values.test_square_versus_point_off_corner_sqrt5_golden", + "eval.tests.test_special_values.test_subnormal_gap_underflows_to_zero_format", + "eval.tests.test_special_values.test_uppercase_INF_coordinate_accepted", + "eval.tests.test_special_values.test_witness_gap_overflow_1e308_golden", + "eval.tests.test_success.test_canonical_dataset_full_output_matches_golden", + "eval.tests.test_success.test_canonical_dataset_reports_reference_distance", + "eval.tests.test_success.test_extra_rows_after_valid_square_ignored", + "eval.tests.test_success.test_extra_trailing_vertex_rows_ignored", + "eval.tests.test_success.test_identical_overlapping_squares_touch", + "eval.tests.test_success.test_integer_and_scientific_notation_vertices", + "eval.tests.test_success.test_large_dense_point_cloud_self_consistent", + "eval.tests.test_success.test_offset_parallel_squares_corner_gap", + "eval.tests.test_success.test_output_has_exact_distance_and_witness_lines", + "eval.tests.test_success.test_overlapping_xy_footprint_z_separated_squares", + "eval.tests.test_success.test_parallel_unit_squares_gap_five", + "eval.tests.test_success.test_parallel_unit_squares_gap_one", + "eval.tests.test_success.test_point_pair_2_3_4_negated_distance", + "eval.tests.test_success.test_point_pair_35_4_12_pythagorean_distance", + "eval.tests.test_success.test_point_pair_3_4_0_distance", + "eval.tests.test_success.test_point_pair_on_axis_distance", + "eval.tests.test_success.test_segment_point_beyond_endpoint", + "eval.tests.test_success.test_segment_point_perpendicular", + "eval.tests.test_success.test_sphere_shell_points_on_axis_gap", + "eval.tests.test_success.test_squares_touching_at_corner", + "eval.tests.test_success.test_two_identical_points_at_origin_distance_zero" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_advanced_behavior.test_translation_invariance_distance_unchanged", + "reasons": [ + { + "id": "golden_docstring", + "message": "pytest test docstring mentions golden data that is not used in the body", + "path": "eval/tests/test_advanced_behavior.py", + "repair_hint": "Use the golden fixture mentioned in the docstring or remove the misleading claim.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_advanced_behavior.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_advanced_behavior.test_body_swap_preserves_distance_and_swaps_witnesses", + "eval.tests.test_advanced_behavior.test_colinear_segments_gap_at_endpoint", + "eval.tests.test_advanced_behavior.test_cube_to_parallel_segment", + "eval.tests.test_advanced_behavior.test_cube_to_point_along_body_diagonal", + "eval.tests.test_advanced_behavior.test_dense_ring_64_vertices_to_point", + "eval.tests.test_advanced_behavior.test_dense_sphere_258_vertices_finite_near_axis", + "eval.tests.test_advanced_behavior.test_dense_stacked_rings_gap", + "eval.tests.test_advanced_behavior.test_fractional_vertex_count_is_deterministic", + "eval.tests.test_advanced_behavior.test_joint_rotation_invariance_distance_unchanged", + "eval.tests.test_advanced_behavior.test_negative_zero_vertex_count_crashes_with_sigsegv", + "eval.tests.test_advanced_behavior.test_partial_overlap_squares_contact", + "eval.tests.test_advanced_behavior.test_perpendicular_planes_share_edge_contact", + "eval.tests.test_advanced_behavior.test_point_above_rectangular_face_interior", + "eval.tests.test_advanced_behavior.test_point_on_cube_top_face_boundary_contact", + "eval.tests.test_advanced_behavior.test_tetrahedra_face_gap", + "eval.tests.test_advanced_behavior.test_translation_invariance_distance_unchanged", + "eval.tests.test_advanced_behavior.test_vertex_count_accepts_leading_sign_and_zeros[+2-expected0]", + "eval.tests.test_advanced_behavior.test_vertex_count_accepts_leading_sign_and_zeros[0002-expected1]", + "eval.tests.test_advanced_behavior.test_vertex_count_whitespace_padded_is_accepted[ 2 ]", + "eval.tests.test_advanced_behavior.test_vertex_count_whitespace_padded_is_accepted[2 \\n ]", + "eval.tests.test_advanced_behavior.test_vertex_count_whitespace_padded_is_accepted[\\t2]", + "eval.tests.test_cli_validation.test_both_files_missing_reports_userP_first", + "eval.tests.test_cli_validation.test_empty_body1_file_exits_1_silently", + "eval.tests.test_cli_validation.test_extra_whitespace_between_coordinates_is_tolerated", + "eval.tests.test_cli_validation.test_fewer_coordinates_than_count_exit_1_silently", + "eval.tests.test_cli_validation.test_leading_comment_lines_fail_to_parse", + "eval.tests.test_cli_validation.test_missing_file_with_wrong_case_name_exits_1[UserP.dat]", + "eval.tests.test_cli_validation.test_missing_file_with_wrong_case_name_exits_1[p.dat]", + "eval.tests.test_cli_validation.test_missing_file_with_wrong_case_name_exits_1[userP.DAT]", + "eval.tests.test_cli_validation.test_missing_file_with_wrong_case_name_exits_1[userp.dat]", + "eval.tests.test_cli_validation.test_missing_userP_reports_error_and_exits_1", + "eval.tests.test_cli_validation.test_missing_userQ_reports_error_and_exits_1", + "eval.tests.test_cli_validation.test_negative_vertex_count_crashes_with_sigsegv", + "eval.tests.test_cli_validation.test_non_numeric_coordinates_exit_1_silently", + "eval.tests.test_cli_validation.test_non_numeric_vertex_count_exits_1_silently", + "eval.tests.test_cli_validation.test_success_prints_distance_and_witnesses", + "eval.tests.test_cli_validation.test_trailing_garbage_after_valid_vertices_is_ignored", + "eval.tests.test_cli_validation.test_whitespace_only_body1_file_exits_1_silently", + "eval.tests.test_cli_validation.test_zero_vertices_crashes_with_sigsegv", + "eval.tests.test_gjk_additional_geometry.test_body2_empty_file_exits_1_silently", + "eval.tests.test_gjk_additional_geometry.test_body2_fewer_coordinates_than_count_exits_1", + "eval.tests.test_gjk_additional_geometry.test_body2_malformed_count_exits_1_silently", + "eval.tests.test_gjk_additional_geometry.test_body2_non_numeric_coordinates_exit_1_silently", + "eval.tests.test_gjk_additional_geometry.test_body2_with_only_two_coordinate_fields_exits_1", + "eval.tests.test_gjk_additional_geometry.test_body2_zero_vertex_count_crashes_with_sigsegv", + "eval.tests.test_gjk_additional_geometry.test_count_with_no_coordinate_rows_eof_exits_1", + "eval.tests.test_gjk_additional_geometry.test_inf_coordinate_reports_inf_distance", + "eval.tests.test_gjk_additional_geometry.test_nan_coordinates_trigger_iteration_cap_and_nan_distance", + "eval.tests.test_gjk_additional_geometry.test_plus_zero_vertex_count_crashes_with_sigsegv", + "eval.tests.test_gjk_additional_geometry.test_point_on_segment_interior_contact", + "eval.tests.test_gjk_additional_geometry.test_regular_decagon_ring_to_point", + "eval.tests.test_gjk_additional_geometry.test_rhombus_diamond_gap_above_center", + "eval.tests.test_gjk_additional_geometry.test_square_pyramid_apex_gap", + "eval.tests.test_gjk_additional_geometry.test_square_pyramid_below_base_center_gap", + "eval.tests.test_gjk_additional_geometry.test_triangular_prism_lateral_edge_gap", + "eval.tests.test_gjk_additional_geometry.test_triangular_prism_vertical_face_gap", + "eval.tests.test_gjk_containment_interpenetration.test_coordinate_row_with_fourth_value_ignored", + "eval.tests.test_gjk_containment_interpenetration.test_coordinate_row_with_only_two_fields_exits_1", + "eval.tests.test_gjk_containment_interpenetration.test_cube_to_point_along_face_diagonal", + "eval.tests.test_gjk_containment_interpenetration.test_cube_to_segment_edge_on_gap", + "eval.tests.test_gjk_containment_interpenetration.test_cubes_interpenetrating_reports_zero", + "eval.tests.test_gjk_containment_interpenetration.test_hexagon_ring_to_point_above_center", + "eval.tests.test_gjk_containment_interpenetration.test_hexagonal_prism_to_point_on_axis", + "eval.tests.test_gjk_containment_interpenetration.test_inner_point_of_cube_lodged_low_within_range[inner0]", + "eval.tests.test_gjk_containment_interpenetration.test_inner_point_of_cube_lodged_low_within_range[inner1]", + "eval.tests.test_gjk_containment_interpenetration.test_near_degenerate_triangle_reports_clean_gap", + "eval.tests.test_gjk_containment_interpenetration.test_overlapping_quadrilaterals_report_zero", + "eval.tests.test_gjk_containment_interpenetration.test_parallel_facing_triangles_gap", + "eval.tests.test_gjk_containment_interpenetration.test_point_above_cube_corner_along_edge_direction", + "eval.tests.test_gjk_containment_interpenetration.test_point_inside_hexagon_hull_is_contained", + "eval.tests.test_gjk_containment_interpenetration.test_point_inside_tetrahedron_is_contained", + "eval.tests.test_gjk_containment_interpenetration.test_point_inside_unit_cube_is_contained", + "eval.tests.test_gjk_containment_interpenetration.test_point_on_flat_triangle_edge_reports_zero", + "eval.tests.test_gjk_containment_interpenetration.test_point_outside_flat_triangle_edge_gap", + "eval.tests.test_gjk_containment_interpenetration.test_segment_threading_through_cube_reports_zero", + "eval.tests.test_gjk_containment_interpenetration.test_skew_perpendicular_segments_gap", + "eval.tests.test_gjk_containment_interpenetration.test_thin_box_to_parallel_segment_face_interior", + "eval.tests.test_gjk_containment_interpenetration.test_witness_separation_equals_distance_containment_zero", + "eval.tests.test_gjk_distance.test_distance_scales_linearly_with_separation[0.5-0.5]", + "eval.tests.test_gjk_distance.test_distance_scales_linearly_with_separation[1.0-10.0]", + "eval.tests.test_gjk_distance.test_distance_scales_linearly_with_separation[100.0-0.01]", + "eval.tests.test_gjk_distance.test_edge_touching_cubes_distance_zero", + "eval.tests.test_gjk_distance.test_identical_cubes_overlap_distance_zero", + "eval.tests.test_gjk_distance.test_large_coordinates_no_overflow_in_distance", + "eval.tests.test_gjk_distance.test_mirror_symmetric_segment_witness_opposite", + "eval.tests.test_gjk_distance.test_non_integer_vertex_coordinates_are_supported", + "eval.tests.test_gjk_distance.test_origin_tetra_to_offset_tetra_exact", + "eval.tests.test_gjk_distance.test_point_pair_witnesses_match_distance[-4-0-0]", + "eval.tests.test_gjk_distance.test_point_pair_witnesses_match_distance[0-0-1]", + "eval.tests.test_gjk_distance.test_point_pair_witnesses_match_distance[0-5-12]", + "eval.tests.test_gjk_distance.test_point_pair_witnesses_match_distance[1--1-1]", + "eval.tests.test_gjk_distance.test_point_pair_witnesses_match_distance[1-2-3]", + "eval.tests.test_gjk_distance.test_sample_pair_matches_known_distance", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[-2 -2 -2-2 2 2-6.928203230275509]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[0 0 0--5 0 12-13.0]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[0 0 0-0 0 0-0.0]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[0 0 0-0 0 7-7.0]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[0 0 0-1 1 1-1.7320508075688772]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[0 0 0-3 4 0-5.0]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[1 2 3-1 2 3-0.0]", + "eval.tests.test_gjk_distance.test_single_point_pair_distance_exact[1.5 -2.5 0-4.5 2.5 0-5.830951894845301]", + "eval.tests.test_gjk_distance.test_tetrahedron_containing_origin_distance_zero", + "eval.tests.test_gjk_distance.test_unit_cube_separated_along_x", + "eval.tests.test_gjk_distance.test_witness_consistency_for_non_touching_pair", + "eval.tests.test_gjk_polytopes.test_box_toward_origin_witness_at_corner", + "eval.tests.test_gjk_polytopes.test_collinear_overlapping_segments_contact", + "eval.tests.test_gjk_polytopes.test_cubes_diagonal_gap_sqrt3", + "eval.tests.test_gjk_polytopes.test_large_separation_reported_exactly", + "eval.tests.test_gjk_polytopes.test_octahedron_inside_cube_touches_face", + "eval.tests.test_gjk_polytopes.test_octahedron_to_point_along_axis", + "eval.tests.test_gjk_polytopes.test_overlapping_coplanar_squares_contact", + "eval.tests.test_gjk_polytopes.test_parallel_flat_squares_separated_in_z", + "eval.tests.test_gjk_polytopes.test_parallel_segments_offset_in_z", + "eval.tests.test_gjk_polytopes.test_parallel_triangles_in_planes", + "eval.tests.test_gjk_polytopes.test_perpendicular_segments_crossing_gap", + "eval.tests.test_gjk_polytopes.test_point_beyond_segment_endpoint_clamps_to_endpoint", + "eval.tests.test_gjk_polytopes.test_point_beyond_triangle_edge", + "eval.tests.test_gjk_polytopes.test_point_closest_to_cube_edge", + "eval.tests.test_gjk_polytopes.test_point_closest_to_cube_face_center", + "eval.tests.test_gjk_polytopes.test_point_inside_cube_zero_witnesses_coincide", + "eval.tests.test_gjk_polytopes.test_point_on_cube_surface_contact", + "eval.tests.test_gjk_polytopes.test_point_over_triangle_interior_barycentric", + "eval.tests.test_gjk_polytopes.test_point_perpendicular_to_segment_interior", + "eval.tests.test_gjk_polytopes.test_prism_to_point_along_axis", + "eval.tests.test_gjk_polytopes.test_repeated_run_identical_output", + "eval.tests.test_gjk_polytopes.test_sample_pair_matches_expected_output", + "eval.tests.test_gjk_polytopes.test_skew_segments_minimum_distance", + "eval.tests.test_gjk_polytopes.test_square_to_point_above_center", + "eval.tests.test_gjk_polytopes.test_tiny_gap_between_cubes", + "eval.tests.test_gjk_polytopes.test_triangle_to_point_above_face", + "eval.tests.test_witness_points.test_degenerate_identical_points_witnesses_coincide", + "eval.tests.test_witness_points.test_distance_nonnegative_and_zero_for_contact", + "eval.tests.test_witness_points.test_witness_on_nearest_vertex_when_separated_along_axis", + "eval.tests.test_witness_points.test_witness_points_are_bounded_by_hull", + "eval.tests.test_witness_points.test_witness_separation_equals_reported_distance[0.5]", + "eval.tests.test_witness_points.test_witness_separation_equals_reported_distance[1.0]", + "eval.tests.test_witness_points.test_witness_separation_equals_reported_distance[3.7]", + "eval.tests.test_witness_points.test_witnesses_are_marked_for_both_bodies" + ] + } + }, + "commit": "2181131c3dc20ba924193152aa10db4e7f377de6", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.6487502126980194, + "eval_clean_hashes": [ + "650a8c6f31cb0c28253f0dbd0949e1bc77bc237730611ad656dfd5ff5d817cb4" + ], + "input_record": { + "commit": "2181131c3dc20ba924193152aa10db4e7f377de6", + "difficulty": "easy", + "difficulty_code_lines": 4454, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 4454, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.6487502126980194, + "difficulty_test_code_lines": 7645, + "full_name": "MattiaMontanari/openGJK", + "input_joern_zip": "cpp_joern/MattiaMontanari__openGJK.zip", + "joern_status": true, + "joern_time": 13.848166855052114, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "OSGeo/PROJ", + "rank": 208, + "similarity": 0.43703728914260864 + } + ], + "repo_path": "cpp/MattiaMontanari__openGJK", + "source": "commit:2181131c3dc20ba924193152aa10db4e7f377de6", + "status": "done", + "url": "https://github.com/MattiaMontanari/openGJK" + }, + "instance_id": "MattiaMontanari__openGJK.2181131", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + } + ], + "repository": "MattiaMontanari/openGJK" +} diff --git a/mattiamontanari--opengjk.2181131/tests/test.sh b/mattiamontanari--opengjk.2181131/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mattiamontanari--opengjk.2181131/tests/workspace.tar.gz b/mattiamontanari--opengjk.2181131/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2240961a51edc6ddc2b19418f0efdafb6c02edca --- /dev/null +++ b/mattiamontanari--opengjk.2181131/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1cc829c1097b861e723201d6516c4b0661018b2ca7710f611638c2376311678 +size 5938 diff --git a/mattiasflodin--reckless.1f0d847/environment/Dockerfile b/mattiasflodin--reckless.1f0d847/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea5dabd15b163b4b12b41d1994ffda06041df226 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mattiasflodin--reckless.1f0d847/environment/docker-compose.yaml b/mattiasflodin--reckless.1f0d847/environment/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mattiasflodin--reckless.1f0d847/environment/download.sh b/mattiasflodin--reckless.1f0d847/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c63209d45172920dc8024405e2b83978b56d921d --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/download.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# ============================================================================ +# ProgramGym stage 1: invoked via `source /source_ro/download.sh` (network +# available). Project: reckless - a zero-overhead C++ logging library. +# +# The reckless static library and its examples are compiled from sources that +# already live in the repository; there are NO third-party library downloads, +# version pins, caches, or package fetching required. The toolchain (g++ 13.3.0 +# and cmake 3.31.12) is present in the base Ubuntu 22.04 image per the C/C++ +# build contract. This script therefore has nothing to download - it only +# exports the environment variable that build.sh relies on to enable the +# examples. It performs no configure, compile, link, or test step. +# +# Source-safety: this file is executed with `source`, so it must not `exit` in +# normal control flow and must not rely on positional arguments. +# ============================================================================ + +say() { printf 'download.sh: %s\n' "$*"; } + +# --- Environment for the offline build stage -------------------------------- +# The selected target is the severity_log example, which the upstream CMake +# build system produces whenever RECKLESS_BUILD_EXAMPLES is ON. build.sh +# imports this value to enable examples and build the selected target. +export RECKLESS_BUILD_EXAMPLES=ON + +say "reckless: no third-party dependencies (toolchain present in base image); nothing to download." diff --git a/mattiasflodin--reckless.1f0d847/environment/executable b/mattiasflodin--reckless.1f0d847/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..ff0f58a73aa0fa0e38965a6790e06352066cf3c6 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2be9650a096cd32cd3466eb2ed147ee2e53eb8a0b213dfcaaed4173877344e62 +size 837672 diff --git a/mattiasflodin--reckless.1f0d847/environment/harbor_configure_apt_mirror.sh b/mattiasflodin--reckless.1f0d847/environment/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mattiasflodin--reckless.1f0d847/environment/harbor_prepare_download_env.sh b/mattiasflodin--reckless.1f0d847/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattiasflodin--reckless.1f0d847/environment/workspace.tar.gz b/mattiasflodin--reckless.1f0d847/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..75872766b1e7658cd7d349479582e64d1208a08d --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec8a9a7d467618e9f072c78c82585935c964ae007ebc034ebda31bfcd4ca46bf +size 4645 diff --git a/mattiasflodin--reckless.1f0d847/instruction.md b/mattiasflodin--reckless.1f0d847/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mattiasflodin--reckless.1f0d847/solution/solve.sh b/mattiasflodin--reckless.1f0d847/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mattiasflodin--reckless.1f0d847/task.toml b/mattiasflodin--reckless.1f0d847/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ce183c4db26f2fa54b43e037a59c0fb61bdd6a57 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mattiasflodin--reckless.1f0d847" +description = "Synthetic ProgramGym cleanroom reconstruction task for mattiasflodin/reckless" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "mattiasflodin__reckless.1f0d847" +repository = "mattiasflodin/reckless" +commit = "1f0d8471cb3f75b785441ad4cea81b16f6ef8814" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.8553979966540686 +test_branches = 5 +test_count = 344 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mattiasflodin--reckless.1f0d847/tests/Dockerfile b/mattiasflodin--reckless.1f0d847/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31c24423705b4d9f115d86d6c410e4b65f06031b --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/Dockerfile @@ -0,0 +1,74 @@ +FROM ubuntu:22.04 +ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL="" +ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct" +ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/" +ARG PROGRAMGYM_NPM_STRICT_SSL="true" +ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple" +ARG PROGRAMGYM_PYPI_TRUSTED_HOST="" +ARG PROGRAMGYM_UV_INSECURE_HOST="" +ENV GOPROXY=${PROGRAMGYM_GOPROXY} +ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST} +ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL} +ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST} +ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY} +ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL} +COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh +RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \ + && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \ + && rm -f /tmp/harbor_configure_apt_mirror.sh +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_cache=/workspace/.cache/npm +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.12 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_01.tar.gz b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..431177adcd8601877c46401def7f7a3a42338f4c --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4118fbb9b790d3e1b8d6bc6973c8e7e191744366e007abb9cc60985a148c6c50 +size 19853 diff --git a/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_02.tar.gz b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9bb09632ec44709fe2037629d06158ea6e59f8fd --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b173e562b8a7aa89ce74558d96d34e578644e0a60cc7dd9fe2a58e2248fe901 +size 21108 diff --git a/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_03.tar.gz b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1d86efc4a262a2587e821854ea84621c02ad7489 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f5ffe594c38026d00a3b84ad60c586cbd86c8f03183105fb0b8e0b5a3617f8a +size 11472 diff --git a/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_04.tar.gz b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..517935e0cb338319e8ab4354e75f2a11b423f391 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d0ab40963b12ae73620c802cc27d84cb9c58ad2e872ca779006bb076fba93d6 +size 22138 diff --git a/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_upstream.tar.gz b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..266bf0ea3c84a23be6c9e83a4ecb0503a5ee89cb --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c28b2d8ae15b2adafd5e0c09bf685b1c5a047fa48a18a9e4e2181b654cdec359 +size 2366 diff --git a/mattiasflodin--reckless.1f0d847/tests/docker-compose.yaml b/mattiasflodin--reckless.1f0d847/tests/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f3bd71ea40d31cf72c3c886f85cbca1450add2cc --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + main: + build: + args: + PROGRAMGYM_APT_REPOSITORY_BASE_URL: ${PROGRAMGYM_APT_REPOSITORY_BASE_URL:-} + PROGRAMGYM_GOPROXY: ${PROGRAMGYM_GOPROXY:-https://proxy.golang.org,direct} + PROGRAMGYM_NPM_REGISTRY: ${PROGRAMGYM_NPM_REGISTRY:-https://registry.npmjs.org/} + PROGRAMGYM_NPM_STRICT_SSL: ${PROGRAMGYM_NPM_STRICT_SSL:-true} + PROGRAMGYM_PYPI_INDEX_URL: ${PROGRAMGYM_PYPI_INDEX_URL:-https://pypi.org/simple} + PROGRAMGYM_PYPI_TRUSTED_HOST: ${PROGRAMGYM_PYPI_TRUSTED_HOST:-} + PROGRAMGYM_UV_INSECURE_HOST: ${PROGRAMGYM_UV_INSECURE_HOST:-} diff --git a/mattiasflodin--reckless.1f0d847/tests/download.sh b/mattiasflodin--reckless.1f0d847/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..c63209d45172920dc8024405e2b83978b56d921d --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/download.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# ============================================================================ +# ProgramGym stage 1: invoked via `source /source_ro/download.sh` (network +# available). Project: reckless - a zero-overhead C++ logging library. +# +# The reckless static library and its examples are compiled from sources that +# already live in the repository; there are NO third-party library downloads, +# version pins, caches, or package fetching required. The toolchain (g++ 13.3.0 +# and cmake 3.31.12) is present in the base Ubuntu 22.04 image per the C/C++ +# build contract. This script therefore has nothing to download - it only +# exports the environment variable that build.sh relies on to enable the +# examples. It performs no configure, compile, link, or test step. +# +# Source-safety: this file is executed with `source`, so it must not `exit` in +# normal control flow and must not rely on positional arguments. +# ============================================================================ + +say() { printf 'download.sh: %s\n' "$*"; } + +# --- Environment for the offline build stage -------------------------------- +# The selected target is the severity_log example, which the upstream CMake +# build system produces whenever RECKLESS_BUILD_EXAMPLES is ON. build.sh +# imports this value to enable examples and build the selected target. +export RECKLESS_BUILD_EXAMPLES=ON + +say "reckless: no third-party dependencies (toolchain present in base image); nothing to download." diff --git a/mattiasflodin--reckless.1f0d847/tests/executable b/mattiasflodin--reckless.1f0d847/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..ff0f58a73aa0fa0e38965a6790e06352066cf3c6 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2be9650a096cd32cd3466eb2ed147ee2e53eb8a0b213dfcaaed4173877344e62 +size 837672 diff --git a/mattiasflodin--reckless.1f0d847/tests/harbor_configure_apt_mirror.sh b/mattiasflodin--reckless.1f0d847/tests/harbor_configure_apt_mirror.sh new file mode 100644 index 0000000000000000000000000000000000000000..c70a651096880dece7733b26837f2ca8e24d2c7f --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/harbor_configure_apt_mirror.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail + +repository_base="${1%/}" +if [[ -z "$repository_base" ]]; then + exit 0 +fi + +. /etc/os-release +codename="${VERSION_CODENAME:-}" +if [[ -z "$codename" ]]; then + echo "VERSION_CODENAME is not set" >&2 + exit 1 +fi + +if [[ "$ID" == "ubuntu" ]]; then + repository_name="apt-proxy" + components="main universe restricted multiverse" +else + repository_name="debian-proxy" + components="main contrib non-free non-free-firmware" +fi + +install -d /etc/apt/sources.list.d +rm -f /etc/apt/sources.list /etc/apt/sources.list.d/* +printf 'deb [trusted=yes] %s/%s %s %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >/etc/apt/sources.list +printf 'deb [trusted=yes] %s/%s %s-updates %s\n' \ + "$repository_base" "$repository_name" "$codename" "$components" \ + >>/etc/apt/sources.list + +if [[ "$ID" != "ubuntu" ]]; then + printf 'deb [trusted=yes] %s/%s %s-security %s\n' \ + "$repository_base" "debian-proxy-security" "$codename" "$components" \ + >>/etc/apt/sources.list +fi diff --git a/mattiasflodin--reckless.1f0d847/tests/harbor_prepare_download_env.sh b/mattiasflodin--reckless.1f0d847/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mattiasflodin--reckless.1f0d847/tests/programgym_evaluator.py b/mattiasflodin--reckless.1f0d847/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mattiasflodin--reckless.1f0d847/tests/programgym_task.json b/mattiasflodin--reckless.1f0d847/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..a80212cad78bbda6a1f50838b51efe81cd2cc1ac --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/programgym_task.json @@ -0,0 +1,969 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_basic_log_errno_aborts.test_log_txt_enotdir_path_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_written_in_test", + "message": "pytest test writes to its own golden file", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Read committed golden data instead of writing expected output inside the test.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errno_aborts.test_log_txt_too_long_name_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errno_aborts.test_log_txt_trailing_slash_symlink_to_dir_aborts", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errno_aborts.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_abort_does_not_create_log_file", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_log_txt_dangling_relative_symlink_aborts", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_log_txt_dangling_symlink_aborts", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_log_txt_is_directory_aborts", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_log_txt_self_loop_symlink_aborts", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_errors.test_log_txt_symlink_to_directory_aborts", + "reasons": [ + { + "id": "no_assertions", + "message": "pytest test contains no assert statements", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Add concrete assert statements over observable executable behavior.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_errors.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_log_txt_is_unix_socket_aborts_enxio", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_socket_component_path_aborts_enotdir", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_symlink_to_unix_socket_aborts_enxio", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_two_hop_chain_to_directory_aborts_eisdir", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_two_hop_chain_to_socket_component_aborts_enotdir", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_two_hop_mutual_cycle_through_subdir_aborts_eloop", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_two_hop_mutual_symlink_loop_aborts_eloop", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_basic_log_special_files.test_two_hop_symlink_chain_to_socket_aborts_enxio", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_basic_log_special_files.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_basic_log_append_state.test_append_does_not_create_two_files", + "eval.tests.test_basic_log_append_state.test_append_preserves_preexisting_content", + "eval.tests.test_basic_log_append_state.test_append_repeated_runs_accumulate_blocks", + "eval.tests.test_basic_log_append_state.test_deterministic_block_structure_across_runs", + "eval.tests.test_basic_log_append_state.test_multiline_preexisting_content_is_respected", + "eval.tests.test_basic_log_append_state.test_run_after_truncate_starts_fresh", + "eval.tests.test_basic_log_append_state.test_second_run_emits_a_complete_second_block", + "eval.tests.test_basic_log_append_variants.test_append_at_large_offset_preserves_preexisting_payload", + "eval.tests.test_basic_log_append_variants.test_append_seed_without_trailing_newline_merges_first_record", + "eval.tests.test_basic_log_append_variants.test_crlf_seed_line_endings_are_preserved", + "eval.tests.test_basic_log_append_variants.test_hard_link_alias_receives_appended_block", + "eval.tests.test_basic_log_append_variants.test_nested_symlink_to_existing_target_writes_through", + "eval.tests.test_basic_log_append_variants.test_precreated_empty_file_still_receives_full_block", + "eval.tests.test_basic_log_append_variants.test_seed_that_mimics_log_records_is_preserved_verbatim", + "eval.tests.test_basic_log_append_variants.test_utf8_multibyte_seed_is_preserved_byte_for_byte", + "eval.tests.test_basic_log_append_variants.test_write_discarding_character_device_dev_zero", + "eval.tests.test_basic_log_args_cwd.test_argument_flags_are_ignored", + "eval.tests.test_basic_log_args_cwd.test_cwd_determines_log_location", + "eval.tests.test_basic_log_args_cwd.test_garbage_arguments_are_ignored", + "eval.tests.test_basic_log_args_cwd.test_no_arguments_is_not_required", + "eval.tests.test_basic_log_args_cwd.test_parent_traversal_not_touched", + "eval.tests.test_basic_log_args_cwd.test_positional_arguments_are_ignored", + "eval.tests.test_basic_log_args_cwd.test_run_from_cwd_with_only_log_after", + "eval.tests.test_basic_log_errno_aborts.test_log_txt_enotdir_path_aborts", + "eval.tests.test_basic_log_errno_aborts.test_log_txt_too_long_name_aborts", + "eval.tests.test_basic_log_errno_aborts.test_log_txt_trailing_slash_symlink_to_dir_aborts", + "eval.tests.test_basic_log_errors.test_abort_does_not_create_log_file", + "eval.tests.test_basic_log_errors.test_character_device_targets_exit_clean[/dev/full-ENOSPC]", + "eval.tests.test_basic_log_errors.test_character_device_targets_exit_clean[/dev/null-discarded]", + "eval.tests.test_basic_log_errors.test_log_txt_dangling_relative_symlink_aborts", + "eval.tests.test_basic_log_errors.test_log_txt_dangling_symlink_aborts", + "eval.tests.test_basic_log_errors.test_log_txt_dev_full_temporary_error_dropped", + "eval.tests.test_basic_log_errors.test_log_txt_dev_null_discards_but_drains", + "eval.tests.test_basic_log_errors.test_log_txt_is_directory_aborts", + "eval.tests.test_basic_log_errors.test_log_txt_self_loop_symlink_aborts", + "eval.tests.test_basic_log_errors.test_log_txt_symlink_to_directory_aborts", + "eval.tests.test_basic_log_errors.test_symlink_to_regular_file_writes_block_there", + "eval.tests.test_basic_log_errors.test_temporary_error_run_leaves_no_partial_data", + "eval.tests.test_basic_log_file_state.test_append_binary_opaque_seed_is_preserved", + "eval.tests.test_basic_log_file_state.test_append_into_sparse_hole_preserves_zero_fill", + "eval.tests.test_basic_log_file_state.test_run_from_symlinked_cwd_writes_to_resolved_dir", + "eval.tests.test_basic_log_file_state.test_sixteen_repeated_runs_accumulate_exact_blocks", + "eval.tests.test_basic_log_file_state.test_two_hop_symlink_chain_resolves_to_final_target", + "eval.tests.test_basic_log_file_state.test_two_hop_symlink_chain_to_discard_device", + "eval.tests.test_basic_log_normal.test_cross_run_message_structure_is_deterministic", + "eval.tests.test_basic_log_normal.test_every_line_matches_full_format_regex", + "eval.tests.test_basic_log_normal.test_log_file_is_a_regular_file", + "eval.tests.test_basic_log_normal.test_log_file_is_valid_utf8_no_nul", + "eval.tests.test_basic_log_normal.test_log_file_readback_ends_with_last_record", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[1]", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[2]", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[3]", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[4]", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[5]", + "eval.tests.test_basic_log_normal.test_normal_run_all_records_share_batch_timestamp[6]", + "eval.tests.test_basic_log_normal.test_normal_run_creates_no_other_files", + "eval.tests.test_basic_log_normal.test_normal_run_every_line_has_single_severity_marker", + "eval.tests.test_basic_log_normal.test_normal_run_exit_zero_and_empty_streams", + "eval.tests.test_basic_log_normal.test_normal_run_float_arg_six_decimals", + "eval.tests.test_basic_log_normal.test_normal_run_indent_policy_four_spaces", + "eval.tests.test_basic_log_normal.test_normal_run_message_bodies_exact", + "eval.tests.test_basic_log_normal.test_normal_run_pointer_arg_is_hex", + "eval.tests.test_basic_log_normal.test_normal_run_produces_exactly_seven_records", + "eval.tests.test_basic_log_normal.test_normal_run_severity_markers_in_order", + "eval.tests.test_basic_log_normal.test_normal_run_signed_int_args_in_order", + "eval.tests.test_basic_log_normal.test_normal_run_string_arg_literal", + "eval.tests.test_basic_log_normal.test_normal_run_timestamp_format_regex", + "eval.tests.test_basic_log_normal.test_stdout_stderr_fd_independence", + "eval.tests.test_basic_log_readonly_aborts.test_readonly_pseudofs_target_aborts_eacces[/proc/sys/kernel/osrelease]", + "eval.tests.test_basic_log_readonly_aborts.test_readonly_pseudofs_target_aborts_eacces[/proc/sys/kernel/ostype]", + "eval.tests.test_basic_log_readonly_aborts.test_readonly_pseudofs_target_aborts_eacces[/proc/sys/kernel/version]", + "eval.tests.test_basic_log_readonly_aborts.test_readonly_pseudofs_target_aborts_erofs[/proc/sys/kernel/hostname]", + "eval.tests.test_basic_log_readonly_aborts.test_readonly_pseudofs_target_aborts_erofs[/proc/sys/vm/swappiness]", + "eval.tests.test_basic_log_special_files.test_log_txt_is_unix_socket_aborts_enxio", + "eval.tests.test_basic_log_special_files.test_socket_component_path_aborts_enotdir", + "eval.tests.test_basic_log_special_files.test_symlink_to_unix_socket_aborts_enxio", + "eval.tests.test_basic_log_special_files.test_two_hop_chain_to_directory_aborts_eisdir", + "eval.tests.test_basic_log_special_files.test_two_hop_chain_to_socket_component_aborts_enotdir", + "eval.tests.test_basic_log_special_files.test_two_hop_mutual_cycle_through_subdir_aborts_eloop", + "eval.tests.test_basic_log_special_files.test_two_hop_mutual_symlink_loop_aborts_eloop", + "eval.tests.test_basic_log_special_files.test_two_hop_symlink_chain_to_socket_aborts_enxio" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_behavior_contract.test_body_sequence_identical_across_working_directories", + "eval.tests.test_behavior_contract.test_full_body_sequence_is_exact_ordered_contract", + "eval.tests.test_behavior_contract.test_message_payloads_stable_between_runs", + "eval.tests.test_behavior_contract.test_non_pointer_bodies_are_literal_stable", + "eval.tests.test_file_mode.test_append_block_has_fresh_timestamp_headers_per_record", + "eval.tests.test_file_mode.test_append_block_is_full_ordered_severity_sequence[]", + "eval.tests.test_file_mode.test_append_block_is_full_ordered_severity_sequence[a\\nb\\nc\\n]", + "eval.tests.test_file_mode.test_append_block_is_full_ordered_severity_sequence[alpha\\n]", + "eval.tests.test_file_mode.test_append_does_not_reapply_creation_mode", + "eval.tests.test_file_mode.test_append_mode_preservation_scales_with_seed_lines[2]", + "eval.tests.test_file_mode.test_append_mode_preservation_scales_with_seed_lines[5]", + "eval.tests.test_file_mode.test_append_mode_preservation_scales_with_seed_lines[8]", + "eval.tests.test_file_mode.test_append_preserves_existing_mode", + "eval.tests.test_file_mode.test_append_preserves_owner_only_mode_with_group_read", + "eval.tests.test_file_mode.test_fresh_file_is_regular_file_mode_under_default_umask", + "eval.tests.test_file_mode.test_fresh_log_is_group_and_other_writable_under_open_umask", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[000-438]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[002-436]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[007-432]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[022-420]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[027-416]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[077-384]", + "eval.tests.test_file_mode.test_fresh_log_mode_follows_umask[777-0]", + "eval.tests.test_file_mode.test_fresh_log_owner_read_write_under_restrictive_umask", + "eval.tests.test_file_mode.test_fresh_log_strict_umask_clears_all_bits", + "eval.tests.test_file_mode.test_hard_link_seeded_append_visible_through_both_with_full_block", + "eval.tests.test_file_mode.test_hard_link_shares_inode_and_append_is_visible_both_names", + "eval.tests.test_file_mode.test_pre_existing_hard_link_is_appended_not_replaced", + "eval.tests.test_invariance.test_body_never_contains_timestamp_payload", + "eval.tests.test_invariance.test_extra_arguments_do_not_change_output", + "eval.tests.test_invariance.test_float_fraction_is_exactly_six_digits", + "eval.tests.test_invariance.test_header_is_single_spaced", + "eval.tests.test_invariance.test_informational_prefixes_each_once", + "eval.tests.test_invariance.test_log_content_is_ascii", + "eval.tests.test_invariance.test_logfile_not_written_when_cwd_missing_write", + "eval.tests.test_invariance.test_no_empty_lines", + "eval.tests.test_invariance.test_pointer_prefix_halfwidth", + "eval.tests.test_invariance.test_single_argument_invocation_identical", + "eval.tests.test_invariance.test_warning_messages_four_distinct_ints", + "eval.tests.test_severity_log.test_all_timestamps_match_format", + "eval.tests.test_severity_log.test_creates_log_file_in_cwd", + "eval.tests.test_severity_log.test_each_line_newline_terminated", + "eval.tests.test_severity_log.test_exit_code_zero", + "eval.tests.test_severity_log.test_field_separator_present_everywhere", + "eval.tests.test_severity_log.test_first_line_debug_severity", + "eval.tests.test_severity_log.test_float_error_formatted_with_precision_six", + "eval.tests.test_severity_log.test_four_severity_warning_lines", + "eval.tests.test_severity_log.test_info_string_formats_literal", + "eval.tests.test_severity_log.test_last_line_error_severity", + "eval.tests.test_severity_log.test_line_header_is_fixed_width", + "eval.tests.test_severity_log.test_log_file_has_seven_lines", + "eval.tests.test_severity_log.test_log_file_nonzero_size", + "eval.tests.test_severity_log.test_message_payloads_all_present", + "eval.tests.test_severity_log.test_no_carriage_return_on_unix", + "eval.tests.test_severity_log.test_only_expected_file_created", + "eval.tests.test_severity_log.test_outside_indent_no_leading_spaces", + "eval.tests.test_severity_log.test_pointer_formats_hex_with_prefix", + "eval.tests.test_severity_log.test_pointer_hex_is_nonempty_lowercase", + "eval.tests.test_severity_log.test_pointer_hex_is_plausible_address", + "eval.tests.test_severity_log.test_precision_one_keeps_nonzero_digit", + "eval.tests.test_severity_log.test_record_order_matches_call_order", + "eval.tests.test_severity_log.test_rerun_appends_to_existing_log", + "eval.tests.test_severity_log.test_second_line_info_severity", + "eval.tests.test_severity_log.test_severity_marker_own_token", + "eval.tests.test_severity_log.test_stable_output_for_fixed_payload", + "eval.tests.test_severity_log.test_stderr_is_empty", + "eval.tests.test_severity_log.test_stdout_is_empty", + "eval.tests.test_severity_log.test_timestamp_consistent_across_run", + "eval.tests.test_severity_log.test_timestamp_four_digit_year", + "eval.tests.test_severity_log.test_timestamp_millisecond_field", + "eval.tests.test_severity_log.test_timestamp_range_sane", + "eval.tests.test_severity_log.test_timestamp_separator_positions", + "eval.tests.test_severity_log.test_two_runs_produce_two_consistent_blocks", + "eval.tests.test_severity_log.test_warning_body_is_exact_bytes[0]", + "eval.tests.test_severity_log.test_warning_body_is_exact_bytes[1]", + "eval.tests.test_severity_log.test_warning_body_is_exact_bytes[2]", + "eval.tests.test_severity_log.test_warning_body_is_exact_bytes[3]", + "eval.tests.test_severity_log.test_warning_int_values_formatted", + "eval.tests.test_severity_log.test_warning_lines_exactly_four_spaces_not_more", + "eval.tests.test_severity_log.test_warning_lines_indented_by_four", + "eval.tests.test_writer_edge_cases.test_abort_stderr_reports_system_error_terminate", + "eval.tests.test_writer_edge_cases.test_abort_writes_no_partial_log_records", + "eval.tests.test_writer_edge_cases.test_append_onto_non_newline_terminated_fuses_first_record", + "eval.tests.test_writer_edge_cases.test_append_onto_trailing_newline_preserves_existing", + "eval.tests.test_writer_edge_cases.test_append_preserves_existing_bytes_exactly", + "eval.tests.test_writer_edge_cases.test_append_through_symlink_targets_linked_file", + "eval.tests.test_writer_edge_cases.test_error_aborts_when_log_is_a_directory", + "eval.tests.test_writer_edge_cases.test_error_branch_only_triggered_by_unwritable_target" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_writers.test_file_permissions_under_umask_022", + "reasons": [ + { + "id": "test_network_dependency", + "message": "test appears to depend on networking", + "path": "eval/tests/test_writers.py", + "repair_hint": "Remove external networking from eval tests; use bundled fixtures or local subprocess behavior.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_writers.test_all_timestamps_share_fixed_width", + "eval.tests.test_writers.test_append_after_stray_trailing_bytes", + "eval.tests.test_writers.test_append_blocks_are_contiguous_and_ordered", + "eval.tests.test_writers.test_append_preserves_preexisting_content_prefix", + "eval.tests.test_writers.test_concurrent_batches_each_keep_severity_order", + "eval.tests.test_writers.test_concurrent_processes_append_atomic_batches", + "eval.tests.test_writers.test_dangling_symlink_creates_target_through_link", + "eval.tests.test_writers.test_dangling_symlink_target_mode_reflects_umask", + "eval.tests.test_writers.test_debug_pointer_is_nonempty_hex", + "eval.tests.test_writers.test_debug_record_pointer_structure", + "eval.tests.test_writers.test_devnull_device_sink_accepts_and_discards", + "eval.tests.test_writers.test_each_record_is_newline_terminated", + "eval.tests.test_writers.test_error_record_float_formatting", + "eval.tests.test_writers.test_error_severity_marker_is_last_record", + "eval.tests.test_writers.test_every_record_carries_timestamp_field", + "eval.tests.test_writers.test_exactly_seven_nonempty_records", + "eval.tests.test_writers.test_exit_code_zero_on_success", + "eval.tests.test_writers.test_external_truncate_then_rerun_appends_one_batch", + "eval.tests.test_writers.test_fifo_sink_streams_records_to_pipe_reader", + "eval.tests.test_writers.test_file_created_when_previously_absent", + "eval.tests.test_writers.test_file_is_created_in_working_directory", + "eval.tests.test_writers.test_file_mode_stable_across_appends", + "eval.tests.test_writers.test_file_mode_with_umask_002", + "eval.tests.test_writers.test_file_mode_with_umask_027", + "eval.tests.test_writers.test_file_mode_with_umask_077", + "eval.tests.test_writers.test_file_permissions_under_umask_022", + "eval.tests.test_writers.test_four_warning_markers_in_normalized_sink", + "eval.tests.test_writers.test_hardlink_append_writes_to_shared_inode", + "eval.tests.test_writers.test_info_record_interpolates_string", + "eval.tests.test_writers.test_long_append_chain_five_runs_makes_35_records", + "eval.tests.test_writers.test_no_arg_invocation_yields_exact_seven_record_sink", + "eval.tests.test_writers.test_no_extra_files_created_in_empty_cwd", + "eval.tests.test_writers.test_open_failure_aborts_with_sigabrt_signal", + "eval.tests.test_writers.test_open_failure_does_not_write_into_directory_sink", + "eval.tests.test_writers.test_open_failure_persists_no_partial_output", + "eval.tests.test_writers.test_open_failure_stderr_exact_diagnostic", + "eval.tests.test_writers.test_open_failure_stderr_is_newline_terminated", + "eval.tests.test_writers.test_open_failure_stderr_names_system_error_and_eisdir", + "eval.tests.test_writers.test_open_failure_stdout_is_empty_bytes", + "eval.tests.test_writers.test_precreated_empty_regular_file_is_filled", + "eval.tests.test_writers.test_prior_batches_intact_after_third_append", + "eval.tests.test_writers.test_record_order_matches_severity_sequence", + "eval.tests.test_writers.test_rerun_appends_records_not_truncates", + "eval.tests.test_writers.test_rerun_does_not_chmod_preexisting_file_mode", + "eval.tests.test_writers.test_severity_markers_present", + "eval.tests.test_writers.test_sink_is_only_a_regular_file", + "eval.tests.test_writers.test_sink_target_name_is_literal_log_txt", + "eval.tests.test_writers.test_stderr_device_sink_streams_all_seven_records", + "eval.tests.test_writers.test_stderr_is_empty_on_success", + "eval.tests.test_writers.test_stdout_device_sink_streams_all_seven_records", + "eval.tests.test_writers.test_stdout_is_empty_for_file_sink", + "eval.tests.test_writers.test_successive_runs_have_matching_structure", + "eval.tests.test_writers.test_symlink_sink_writes_through_to_linked_file", + "eval.tests.test_writers.test_symlink_to_directory_aborts_like_directory_sink", + "eval.tests.test_writers.test_third_run_triples_record_count", + "eval.tests.test_writers.test_three_batches_identical_after_normalization", + "eval.tests.test_writers.test_timestamp_has_millisecond_precision", + "eval.tests.test_writers.test_timestamp_has_valid_calendar_date", + "eval.tests.test_writers.test_umask_applies_to_records_not_content", + "eval.tests.test_writers.test_variable_format_lines_not_split_or_merged", + "eval.tests.test_writers.test_warning_indices_are_0_to_3", + "eval.tests.test_writers.test_warning_payloads_listed_in_ascending_order", + "eval.tests.test_writers.test_warning_records_are_five_marked_and_indented" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_clock_and_pointer_semantics.test_each_of_two_appended_batches_keeps_its_own_identical_timestamp", + "reasons": [ + { + "id": "all_assertions_weak", + "message": "pytest test uses only weak assertions", + "path": "eval/tests/test_clock_and_pointer_semantics.py", + "repair_hint": "Add at least one semantic oracle over concrete output, files, schema, or state.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_async_pipeline_stress.test_accumulated_batches_scale_line_count", + "eval.tests.test_async_pipeline_stress.test_appended_batches_preserve_internal_order", + "eval.tests.test_async_pipeline_stress.test_concurrent_runs_in_separate_dirs_are_independent", + "eval.tests.test_async_pipeline_stress.test_each_batch_has_independent_complete_record_set", + "eval.tests.test_async_pipeline_stress.test_termination_sequence_repeats_across_batches", + "eval.tests.test_async_pipeline_stress.test_warning_instances_accumulate_per_run", + "eval.tests.test_clock_and_pointer_semantics.test_all_records_in_fresh_batch_share_identical_timestamp", + "eval.tests.test_clock_and_pointer_semantics.test_each_of_two_appended_batches_keeps_its_own_identical_timestamp", + "eval.tests.test_clock_and_pointer_semantics.test_pointer_address_is_fresh_between_two_runs", + "eval.tests.test_clock_and_pointer_semantics.test_pointer_address_is_valid_hex_of_positive_length", + "eval.tests.test_device_sink_semantics.test_full_device_run_repeatable", + "eval.tests.test_device_sink_semantics.test_full_device_write_failure_not_surfaced", + "eval.tests.test_device_sink_semantics.test_null_symlink_run_exits_zero_silently", + "eval.tests.test_device_sink_semantics.test_null_symlink_target_unchanged_after_run", + "eval.tests.test_device_sink_semantics.test_zero_device_sink_accepts_writes_silently", + "eval.tests.test_file_writer_edge_cases.test_batch_after_binary_seed_is_ascii_framed", + "eval.tests.test_file_writer_edge_cases.test_batch_still_newline_terminated_after_partial_seed", + "eval.tests.test_file_writer_edge_cases.test_binary_seed_bytes_preserved_byte_exact", + "eval.tests.test_file_writer_edge_cases.test_large_existing_logfile_appended_at_end", + "eval.tests.test_file_writer_edge_cases.test_pre_existing_blank_rows_preserved", + "eval.tests.test_file_writer_edge_cases.test_record_appends_onto_partial_last_line", + "eval.tests.test_file_writer_edge_cases.test_symlink_to_directory_causes_same_abort", + "eval.tests.test_file_writer_edge_cases.test_symlink_to_directory_leaves_links_intact", + "eval.tests.test_log_content.test_all_lines_match_severity_format_regex", + "eval.tests.test_log_content.test_debug_line_not_indented", + "eval.tests.test_log_content.test_each_warning_number_present", + "eval.tests.test_log_content.test_error_line_content_exact", + "eval.tests.test_log_content.test_first_line_debug_severity", + "eval.tests.test_log_content.test_info_line_content_exact", + "eval.tests.test_log_content.test_info_line_not_indented", + "eval.tests.test_log_content.test_last_line_error_severity", + "eval.tests.test_log_content.test_pointer_line_present_with_hex_address", + "eval.tests.test_log_content.test_pointer_starts_with_zero_x_prefix", + "eval.tests.test_log_content.test_second_line_info_severity", + "eval.tests.test_log_content.test_warning_lines_carry_warning_severity", + "eval.tests.test_log_content.test_warning_lines_indented_with_four_spaces", + "eval.tests.test_log_creation.test_exit_code_is_zero_on_clean_run", + "eval.tests.test_log_creation.test_logfile_is_a_regular_file", + "eval.tests.test_log_creation.test_logfile_is_created_in_workdir", + "eval.tests.test_log_creation.test_logfile_is_nonempty", + "eval.tests.test_log_creation.test_logfile_placed_in_cwd_not_source_tree", + "eval.tests.test_log_creation.test_no_logfile_leaked_to_parent_directory", + "eval.tests.test_log_creation.test_no_stderr_output_on_clean_run", + "eval.tests.test_log_creation.test_no_stdout_output", + "eval.tests.test_log_creation.test_only_logfile_created_in_workdir", + "eval.tests.test_log_creation.test_runs_from_different_cwds_each_create_local_log", + "eval.tests.test_log_file_semantics.test_append_second_run_adds_another_seven_records", + "eval.tests.test_log_file_semantics.test_directory_collision_causes_nonzero_exit", + "eval.tests.test_log_file_semantics.test_directory_collision_leaves_dir_intact", + "eval.tests.test_log_file_semantics.test_directory_collision_leaves_stdout_empty", + "eval.tests.test_log_file_semantics.test_directory_collision_reports_to_stderr", + "eval.tests.test_log_file_semantics.test_new_records_follow_old_records_in_file", + "eval.tests.test_log_file_semantics.test_old_and_new_records_both_present_after_append", + "eval.tests.test_log_file_semantics.test_record_count_stable_across_runs", + "eval.tests.test_log_file_semantics.test_run_appends_to_existing_logfile", + "eval.tests.test_log_file_semantics.test_severity_sequence_repeatable_across_two_runs", + "eval.tests.test_log_file_semantics.test_trailing_newline_terminates_each_run_records", + "eval.tests.test_log_order.test_all_warnings_precede_error_record", + "eval.tests.test_log_order.test_debug_record_before_info_record", + "eval.tests.test_log_order.test_each_expected_marker_appears_exactly_once_in_order", + "eval.tests.test_log_order.test_error_record_is_last", + "eval.tests.test_log_order.test_info_record_before_first_warning", + "eval.tests.test_log_order.test_no_record_count_duplicated_or_dropped", + "eval.tests.test_log_order.test_severity_sequence_is_d_i_w_w_w_w_e", + "eval.tests.test_log_order.test_warnings_appear_in_ascending_order", + "eval.tests.test_log_structure.test_each_record_content_is_nonempty", + "eval.tests.test_log_structure.test_each_record_ends_with_newline", + "eval.tests.test_log_structure.test_exactly_seven_record_lines", + "eval.tests.test_log_structure.test_no_blank_lines_between_records", + "eval.tests.test_log_structure.test_severity_field_is_single_character_followed_by_space", + "eval.tests.test_log_structure.test_single_space_separates_timestamp_from_content", + "eval.tests.test_log_structure.test_timestamp_date_uses_dash_separators", + "eval.tests.test_log_structure.test_timestamp_field_present_on_every_line", + "eval.tests.test_log_structure.test_timestamp_format_is_utc_like_datetime_ms", + "eval.tests.test_log_structure.test_timestamp_time_uses_colon_and_dot", + "eval.tests.test_open_failure_branches.test_directory_collision_stderr_still_exact", + "eval.tests.test_open_failure_branches.test_missing_intermediate_dir_aborts_with_enoent", + "eval.tests.test_open_failure_branches.test_missing_intermediate_dir_is_not_created", + "eval.tests.test_open_failure_branches.test_self_symlink_loop_aborts_with_eloop", + "eval.tests.test_open_failure_branches.test_three_open_failures_yield_pairwise_distinct_stderr", + "eval.tests.test_open_failure_branches.test_two_node_symlink_cycle_aborts_with_eloop", + "eval.tests.test_severity_dispatch.test_each_record_type_label_present[debug_label]", + "eval.tests.test_severity_dispatch.test_each_record_type_label_present[error_label]", + "eval.tests.test_severity_dispatch.test_each_record_type_label_present[info_label]", + "eval.tests.test_severity_dispatch.test_each_record_type_label_present[warning_label]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_1_112]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_1_48]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_1_63]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_1_88]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_2_68]", + "eval.tests.test_severity_dispatch.test_no_unknown_severity_markers[reject_3_68]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_0]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_1]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_2]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_3]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_4]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_5]", + "eval.tests.test_severity_dispatch.test_record_index_has_expected_severity[line_6]", + "eval.tests.test_severity_dispatch.test_severity_marker_is_recognized[debug]", + "eval.tests.test_severity_dispatch.test_severity_marker_is_recognized[error]", + "eval.tests.test_severity_dispatch.test_severity_marker_is_recognized[info]", + "eval.tests.test_severity_dispatch.test_severity_marker_is_recognized[warning]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[D_Pointer:]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[E_Error:]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[I_Info]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[W_Warning:0]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[W_Warning:1]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[W_Warning:2]", + "eval.tests.test_severity_dispatch.test_severity_marker_pairs_with_content[W_Warning:3]", + "eval.tests.test_severity_dispatch.test_warning_number_has_correct_index[warning_0]", + "eval.tests.test_severity_dispatch.test_warning_number_has_correct_index[warning_1]", + "eval.tests.test_severity_dispatch.test_warning_number_has_correct_index[warning_2]", + "eval.tests.test_severity_dispatch.test_warning_number_has_correct_index[warning_3]", + "eval.tests.test_symlink_and_link_semantics.test_broken_symlink_creates_missing_target", + "eval.tests.test_symlink_and_link_semantics.test_broken_symlink_leaves_no_regular_logfile", + "eval.tests.test_symlink_and_link_semantics.test_hard_link_target_gets_batch", + "eval.tests.test_symlink_and_link_semantics.test_symlink_chain_follows_to_terminal_file", + "eval.tests.test_symlink_and_link_semantics.test_symlink_target_preserved_not_rewritten", + "eval.tests.test_symlink_and_link_semantics.test_symlink_to_regular_file_redirects_batch", + "eval.tests.test_symlink_and_link_semantics.test_symlinked_frames_all_match_expected_format", + "eval.tests.test_symlink_and_link_semantics.test_two_runs_via_symlink_accumulate_in_target", + "eval.tests.test_timestamp_and_seed_variants.test_crlf_seed_bytes_preserved_byte_exact", + "eval.tests.test_timestamp_and_seed_variants.test_run_onto_empty_existing_logfile_appends_batch", + "eval.tests.test_timestamp_and_seed_variants.test_second_batch_timestamps_all_after_first_batch", + "eval.tests.test_timestamp_and_seed_variants.test_timestamps_are_non_decreasing_within_a_batch", + "eval.tests.test_timestamp_and_seed_variants.test_timestamps_cover_same_run_scope", + "eval.tests.test_timestamp_and_seed_variants.test_utf8_multibyte_seed_preserved_byte_exact", + "eval.tests.test_timestamp_and_seed_variants.test_utf8_seed_does_not_shift_record_framing" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_severity_log_harvest.test_file_writer_appends_each_run_statefully", + "eval.tests.test_severity_log_harvest.test_severity_log_emits_documented_basic_use_output", + "eval.tests.test_severity_log_harvest.test_severity_log_format_conversion_per_record" + ] + } + }, + "commit": "1f0d8471cb3f75b785441ad4cea81b16f6ef8814", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.8553979966540686, + "eval_clean_hashes": [ + "2be9650a096cd32cd3466eb2ed147ee2e53eb8a0b213dfcaaed4173877344e62" + ], + "input_record": { + "commit": "1f0d8471cb3f75b785441ad4cea81b16f6ef8814", + "difficulty": "easy", + "difficulty_code_lines": 7168, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 7168, + "difficulty_runtime_deps": 0, + "difficulty_score": 1.8553979966540686, + "difficulty_test_code_lines": 1285, + "full_name": "mattiasflodin/reckless", + "input_joern_zip": "cpp_joern/mattiasflodin__reckless.zip", + "joern_status": true, + "joern_time": 10.377525207120925, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "duckdb/duckdb", + "rank": 746, + "similarity": 0.4330001473426819 + }, + { + "pb_fullname": "ip7z/7zip", + "rank": 570, + "similarity": 0.39381515979766846 + }, + { + "pb_fullname": "tstack/lnav", + "rank": 21, + "similarity": 0.5448611974716187 + }, + { + "pb_fullname": "NikolaDucak/caps-log", + "rank": 216, + "similarity": 0.4394875168800354 + } + ], + "repo_path": "cpp/mattiasflodin__reckless", + "source": "commit:1f0d8471cb3f75b785441ad4cea81b16f6ef8814", + "status": "done", + "url": "https://github.com/mattiasflodin/reckless" + }, + "instance_id": "mattiasflodin__reckless.1f0d847", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_04", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "source", + "termination_reason": "early_stopping" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 5, + "module_kind": "tests", + "termination_reason": "early_stopping" + } + ], + "repository": "mattiasflodin/reckless" +} diff --git a/mattiasflodin--reckless.1f0d847/tests/test.sh b/mattiasflodin--reckless.1f0d847/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mattiasflodin--reckless.1f0d847/tests/workspace.tar.gz b/mattiasflodin--reckless.1f0d847/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..75872766b1e7658cd7d349479582e64d1208a08d --- /dev/null +++ b/mattiasflodin--reckless.1f0d847/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec8a9a7d467618e9f072c78c82585935c964ae007ebc034ebda31bfcd4ca46bf +size 4645 diff --git a/mattolenik--hclq.5b31af0/environment/Dockerfile b/mattolenik--hclq.5b31af0/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6f371332b0892136e00733449b81644d11444adf --- /dev/null +++ b/mattolenik--hclq.5b31af0/environment/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mattolenik--hclq.5b31af0/environment/download.sh b/mattolenik--hclq.5b31af0/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..0b5e7f11b8ce2f513045a42172585a400a125bf3 --- /dev/null +++ b/mattolenik--hclq.5b31af0/environment/download.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=local +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mattolenik/hclq + +go 1.12 + +require ( + github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 + github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85 + github.com/spf13/pflag v1.0.3 // indirect + github.com/stretchr/testify v1.3.0 + github.com/tcnksm/ghr v0.12.1 + github.com/valyala/fastjson v1.4.1 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Songmu/retry v0.1.0 h1:hPA5xybQsksLR/ry/+t/7cFajPW+dqjmjhzZhioBILA= +github.com/Songmu/retry v0.1.0/go.mod h1:7sXIW7eseB9fq0FUvigRcQMVLR9tuHI0Scok+rkpAuA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157 h1:PJ+K03hio6ADVjEc6lFu5r866o67xEEMQ73CFdI6R2U= +github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85 h1:UQHWkFUuJBy5rWN1DxosG/efssLu7u0fXXSTC2HHKfQ= +github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/tcnksm/ghr v0.12.1 h1:oYNULfAztAbkKopO25yvj6p3vfJxQKsnbuPplVWnQII= +github.com/tcnksm/ghr v0.12.1/go.mod h1:tcp6tzbRYE0LqFSG7ykXP/BVG1/2BkX6aIn9FFV1mIQ= +github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= +github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= +github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e h1:IWllFTiDjjLIf2oeKxpIUmtiDV5sn71VgeQgg6vcE7k= +github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e/go.mod h1:d7u6HkTYKSv5m6MCKkOQlHwaShTMl3HjqSGW3XtVhXM= +github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= +github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/mattolenik--hclq.5b31af0/environment/executable b/mattolenik--hclq.5b31af0/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..0691eb95c9a0d171cedd94a44bd688f13901fa3a --- /dev/null +++ b/mattolenik--hclq.5b31af0/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba98b9ae5fcea317b81761df0a68770039a01681c9d4a5c87d10cb7a8db7467e +size 5929296 diff --git a/mattolenik--hclq.5b31af0/environment/programgym-go.tar.gz b/mattolenik--hclq.5b31af0/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mattolenik--hclq.5b31af0/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mattolenik--hclq.5b31af0/environment/workspace.tar.gz b/mattolenik--hclq.5b31af0/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a6a123faf2e7c6fac062359af7e62a477bdfa3e7 --- /dev/null +++ b/mattolenik--hclq.5b31af0/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ea567f8f55e0fa59c2a766b30aafa0fb9e8b505bbef3df1e2abecda3eda10f7 +size 4337 diff --git a/mattolenik--hclq.5b31af0/instruction.md b/mattolenik--hclq.5b31af0/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mattolenik--hclq.5b31af0/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mattolenik--hclq.5b31af0/solution/solve.sh b/mattolenik--hclq.5b31af0/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mattolenik--hclq.5b31af0/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mattolenik--hclq.5b31af0/task.toml b/mattolenik--hclq.5b31af0/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1a4c0479185e1b12d914398de1779fc8c94113b3 --- /dev/null +++ b/mattolenik--hclq.5b31af0/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mattolenik--hclq.5b31af0" +description = "Synthetic ProgramGym cleanroom reconstruction task for mattolenik/hclq" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "mattolenik__hclq.5b31af0" +repository = "mattolenik/hclq" +commit = "5b31af0dc21001c2ac770c1bea142b0e2ca0ef56" +language = "go" +difficulty = "unknown" +difficulty_score = 0.0 +test_branches = 4 +test_count = 674 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mattolenik--hclq.5b31af0/tests/Dockerfile b/mattolenik--hclq.5b31af0/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bd5f12bacd787ef39a90a560bc0dec968dcdb06e --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_01.tar.gz b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c3f251030967db27f729825bf2ff031cfc39b594 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8b5f13cc4d113decb24bb5b6dacf4cfa4eb641ff63be2620901ddc29bfeac60 +size 13131 diff --git a/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_02.tar.gz b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..84cecb0ef19c3111ab7ee7f331c33c999fabe1bc --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6bd66c804ab6ab5aed9932c9b3c38778215cf62ad0b06958923858fb8912f44 +size 15189 diff --git a/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_03.tar.gz b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b09e9302c5a28679791b29d7cefce3656021b126 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6baf8b14146308286e22a44e38209f070f7a67957a33616a7fc28afdbc81989c +size 14882 diff --git a/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_04.tar.gz b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_04.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ea85cfa29f58af1aee79f8cca3a95fd2dec3eea9 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/blobs/tests/generated_module_04.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3b50eed681cd20343c44a44e4bb2c16d4c72e080dc07eb5e6fc84dc71181cf6 +size 18739 diff --git a/mattolenik--hclq.5b31af0/tests/download.sh b/mattolenik--hclq.5b31af0/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..0b5e7f11b8ce2f513045a42172585a400a125bf3 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/download.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=local +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/mattolenik/hclq + +go 1.12 + +require ( + github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 + github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85 + github.com/spf13/pflag v1.0.3 // indirect + github.com/stretchr/testify v1.3.0 + github.com/tcnksm/ghr v0.12.1 + github.com/valyala/fastjson v1.4.1 +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/Songmu/retry v0.1.0 h1:hPA5xybQsksLR/ry/+t/7cFajPW+dqjmjhzZhioBILA= +github.com/Songmu/retry v0.1.0/go.mod h1:7sXIW7eseB9fq0FUvigRcQMVLR9tuHI0Scok+rkpAuA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157 h1:PJ+K03hio6ADVjEc6lFu5r866o67xEEMQ73CFdI6R2U= +github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85 h1:UQHWkFUuJBy5rWN1DxosG/efssLu7u0fXXSTC2HHKfQ= +github.com/spf13/cobra v0.0.0-20190109003409-7547e83b2d85/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/tcnksm/ghr v0.12.1 h1:oYNULfAztAbkKopO25yvj6p3vfJxQKsnbuPplVWnQII= +github.com/tcnksm/ghr v0.12.1/go.mod h1:tcp6tzbRYE0LqFSG7ykXP/BVG1/2BkX6aIn9FFV1mIQ= +github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= +github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= +github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e h1:IWllFTiDjjLIf2oeKxpIUmtiDV5sn71VgeQgg6vcE7k= +github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e/go.mod h1:d7u6HkTYKSv5m6MCKkOQlHwaShTMl3HjqSGW3XtVhXM= +github.com/valyala/fastjson v1.4.1 h1:hrltpHpIpkaxll8QltMU8c3QZ5+qIiCL8yKqPFJI/yE= +github.com/valyala/fastjson v1.4.1/go.mod h1:nV6MsjxL2IMJQUoHDIrjEI7oLyeqK6aBD7EFWPsvP8o= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +PROGRAMGYM_GO_SUM_EOF +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/mattolenik--hclq.5b31af0/tests/executable b/mattolenik--hclq.5b31af0/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..0691eb95c9a0d171cedd94a44bd688f13901fa3a --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba98b9ae5fcea317b81761df0a68770039a01681c9d4a5c87d10cb7a8db7467e +size 5929296 diff --git a/mattolenik--hclq.5b31af0/tests/programgym-go.tar.gz b/mattolenik--hclq.5b31af0/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/mattolenik--hclq.5b31af0/tests/programgym_evaluator.py b/mattolenik--hclq.5b31af0/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mattolenik--hclq.5b31af0/tests/programgym_task.json b/mattolenik--hclq.5b31af0/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..9c532a8787a988321ed2d6c5d24f6c8402849238 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/programgym_task.json @@ -0,0 +1,951 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_entry.test_append_help_renders", + "eval.tests.test_cli_entry.test_dash_dash_help_prints_root_help", + "eval.tests.test_cli_entry.test_dash_h_prints_get_help", + "eval.tests.test_cli_entry.test_dash_h_prints_root_help", + "eval.tests.test_cli_entry.test_get_help_renders_child_and_keys", + "eval.tests.test_cli_entry.test_keys_help_advertises_raw_flag", + "eval.tests.test_cli_entry.test_no_args_prints_root_help_to_stdout", + "eval.tests.test_cli_entry.test_prepend_help_renders", + "eval.tests.test_cli_entry.test_replace_help_renders_with_replace_n_flag", + "eval.tests.test_cli_entry.test_set_help_renders_children", + "eval.tests.test_cli_entry.test_unknown_flag_errors", + "eval.tests.test_cli_entry.test_unknown_subcommand_errors", + "eval.tests.test_cli_entry.test_version_flag_is_not_registered", + "eval.tests.test_get.test_get_bool_list_raw_values", + "eval.tests.test_get.test_get_deep_nested_dotted_path", + "eval.tests.test_get.test_get_empty_document_returns_empty_list", + "eval.tests.test_get.test_get_from_input_file", + "eval.tests.test_get.test_get_from_nonexistent_input_file_error", + "eval.tests.test_get.test_get_list_index[-1-3]", + "eval.tests.test_get.test_get_list_index[0-1]", + "eval.tests.test_get.test_get_list_index[1-2]", + "eval.tests.test_get.test_get_list_index[2-3]", + "eval.tests.test_get.test_get_list_index_out_of_bounds[a[-6]-Error: index -3 out of bounds on list a of len 3]", + "eval.tests.test_get.test_get_list_index_out_of_bounds[a[5]-Error: index 5 out of bounds on list a of len 3]", + "eval.tests.test_get.test_get_list_index_string_element_json", + "eval.tests.test_get.test_get_list_index_string_element_raw", + "eval.tests.test_get.test_get_list_inside_object_json", + "eval.tests.test_get.test_get_list_inside_object_raw", + "eval.tests.test_get.test_get_list_of_object_subfield_query_type_error", + "eval.tests.test_get.test_get_list_query_on_scalar_errors", + "eval.tests.test_get.test_get_list_raw_numeric", + "eval.tests.test_get.test_get_list_raw_space_separated", + "eval.tests.test_get.test_get_list_whole_json[a = [\"a\", \"b\"]-a[]-[\"a\",\"b\"]]", + "eval.tests.test_get.test_get_list_whole_json[a = [1, 2, 3]-a[]-[1,2,3]]", + "eval.tests.test_get.test_get_list_whole_json[a = [12]-a[]-[12]]", + "eval.tests.test_get.test_get_list_whole_json[a = []-a[]-[]]", + "eval.tests.test_get.test_get_malformed_input_error", + "eval.tests.test_get.test_get_missing_query_argument_error", + "eval.tests.test_get.test_get_negative_index_past_wraparound_edge", + "eval.tests.test_get.test_get_negative_index_raw", + "eval.tests.test_get.test_get_nested_object_json", + "eval.tests.test_get.test_get_nested_object_raw", + "eval.tests.test_get.test_get_nonexistent_key_returns_empty_list", + "eval.tests.test_get.test_get_nonlist_query_on_list_errors", + "eval.tests.test_get.test_get_object_attribute_whole_returns_empty_list", + "eval.tests.test_get.test_get_output_file_is_directory_error", + "eval.tests.test_get.test_get_raw_list_with_embedded_space", + "eval.tests.test_get.test_get_raw_object_attribute_prints_blank_line", + "eval.tests.test_get.test_get_regex_list_query", + "eval.tests.test_get.test_get_regex_single_match_no_list", + "eval.tests.test_get.test_get_scalar_bool_json", + "eval.tests.test_get.test_get_scalar_number_json", + "eval.tests.test_get.test_get_scalar_number_raw", + "eval.tests.test_get.test_get_scalar_string_json", + "eval.tests.test_get.test_get_scalar_string_raw", + "eval.tests.test_get.test_get_short_raw_flag_shorthand_nested", + "eval.tests.test_get.test_get_too_many_arguments_error", + "eval.tests.test_get.test_get_wildcard_across_objects", + "eval.tests.test_get.test_get_wildcard_preserves_source_order", + "eval.tests.test_get.test_get_wildcard_raw_values", + "eval.tests.test_get.test_get_write_output_file_raw", + "eval.tests.test_get.test_get_writes_output_file", + "eval.tests.test_io_routing.test_default_stdout_has_trailing_newline_for_get", + "eval.tests.test_io_routing.test_empty_stdin_get_yields_empty_list", + "eval.tests.test_io_routing.test_in_flag_overrides_stdin", + "eval.tests.test_io_routing.test_in_place_roundtrip_append", + "eval.tests.test_io_routing.test_malformed_stdin_set_errors", + "eval.tests.test_io_routing.test_out_and_in_different_files", + "eval.tests.test_io_routing.test_out_flag_overrides_stdout", + "eval.tests.test_io_routing.test_raw_and_output_file_combined", + "eval.tests.test_io_routing.test_regex_replace_then_get_roundtrip_file", + "eval.tests.test_io_routing.test_roundtrip_append_then_get", + "eval.tests.test_io_routing.test_roundtrip_set_then_get", + "eval.tests.test_io_routing.test_set_output_has_no_trailing_newline", + "eval.tests.test_io_routing.test_short_in_flag_shorthand_reads_file", + "eval.tests.test_io_routing.test_short_out_flag_shorthand_writes_file", + "eval.tests.test_io_routing.test_stdin_is_default_input_source", + "eval.tests.test_io_routing.test_unknown_subcommand_under_set_reports_arg_count", + "eval.tests.test_keys.test_keys_empty_document_returns_empty_array", + "eval.tests.test_keys.test_keys_input_file_missing_error", + "eval.tests.test_keys.test_keys_list_index_returns_key", + "eval.tests.test_keys.test_keys_list_query_on_scalar_wrong_type_error", + "eval.tests.test_keys.test_keys_list_query_returns_key", + "eval.tests.test_keys.test_keys_malformed_input_error", + "eval.tests.test_keys.test_keys_missing_query_argument_error", + "eval.tests.test_keys.test_keys_mixed_object_and_scalar_document", + "eval.tests.test_keys.test_keys_nested_block_json", + "eval.tests.test_keys.test_keys_nested_block_raw", + "eval.tests.test_keys.test_keys_nonexistent_returns_empty_array", + "eval.tests.test_keys.test_keys_on_list_errors", + "eval.tests.test_keys.test_keys_out_of_bounds_index_error", + "eval.tests.test_keys.test_keys_output_file_is_directory_error", + "eval.tests.test_keys.test_keys_raw_multi", + "eval.tests.test_keys.test_keys_raw_single", + "eval.tests.test_keys.test_keys_regex_no_match_empty", + "eval.tests.test_keys.test_keys_regex_query_matches_keys", + "eval.tests.test_keys.test_keys_short_raw_flag_shorthand", + "eval.tests.test_keys.test_keys_single_key_json", + "eval.tests.test_keys.test_keys_top_level_json", + "eval.tests.test_keys.test_keys_uses_input_file", + "eval.tests.test_keys.test_keys_wildcard_nested_two_objects", + "eval.tests.test_keys.test_keys_writes_output_file", + "eval.tests.test_set.test_append_argument_count_error", + "eval.tests.test_set.test_append_bad_json_errors", + "eval.tests.test_set.test_append_bool_to_list", + "eval.tests.test_set.test_append_nested_string_value", + "eval.tests.test_set.test_append_object_to_list", + "eval.tests.test_set.test_append_object_with_multiple_keys", + "eval.tests.test_set.test_append_scalar_to_list", + "eval.tests.test_set.test_append_string_to_string", + "eval.tests.test_set.test_append_to_string_backed_number", + "eval.tests.test_set.test_append_via_regex_list_updates_only_matching", + "eval.tests.test_set.test_append_writes_output_file", + "eval.tests.test_set.test_prepend_argument_count_error", + "eval.tests.test_set.test_prepend_json_array_to_list", + "eval.tests.test_set.test_prepend_list_value_with_nonlist_node_panics", + "eval.tests.test_set.test_prepend_nested_string", + "eval.tests.test_set.test_prepend_scalar_to_list_panics", + "eval.tests.test_set.test_prepend_string", + "eval.tests.test_set.test_replace_all_occurrences_by_default", + "eval.tests.test_set.test_replace_argument_count_error", + "eval.tests.test_set.test_replace_in_place_stateful_chain", + "eval.tests.test_set.test_replace_limited_to_one_occurrence", + "eval.tests.test_set.test_replace_limited_to_two_occurrences", + "eval.tests.test_set.test_replace_n_zero_leaves_unchanged", + "eval.tests.test_set.test_replace_no_match_leaves_unchanged", + "eval.tests.test_set.test_replace_numeric_token", + "eval.tests.test_set.test_replace_on_list_panics_unimplemented", + "eval.tests.test_set.test_replace_with_regex_query", + "eval.tests.test_set.test_replace_writes_output_file", + "eval.tests.test_set.test_set_edits_input_file_in_place", + "eval.tests.test_set.test_set_empty_string_value", + "eval.tests.test_set.test_set_in_place_conflicts_with_out", + "eval.tests.test_set.test_set_in_place_without_input_file_error", + "eval.tests.test_set.test_set_list_bad_json_errors", + "eval.tests.test_set.test_set_list_from_json", + "eval.tests.test_set.test_set_one_argument_error", + "eval.tests.test_set.test_set_replace_n_large_equals_replace_all", + "eval.tests.test_set.test_set_replace_negative_n_replaces_all", + "eval.tests.test_set.test_set_replaces_nested_value", + "eval.tests.test_set.test_set_replaces_nested_value_preserving_siblings", + "eval.tests.test_set.test_set_scalar_bool_value", + "eval.tests.test_set.test_set_scalar_float_value", + "eval.tests.test_set.test_set_scalar_hex_value", + "eval.tests.test_set.test_set_scalar_number", + "eval.tests.test_set.test_set_scalar_string_preserves_quotes", + "eval.tests.test_set.test_set_scientific_notation_value", + "eval.tests.test_set.test_set_uses_input_file", + "eval.tests.test_set.test_set_value_of_only_spaces", + "eval.tests.test_set.test_set_value_with_multiple_words", + "eval.tests.test_set.test_set_wildcard_regex_list_json_rewrite", + "eval.tests.test_set.test_set_wildcard_replaces_all_matches", + "eval.tests.test_set.test_set_writes_list_output_file", + "eval.tests.test_set.test_set_writes_output_file", + "eval.tests.test_set.test_set_zero_arguments_error" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_config_routing_more_edges.test_malformed_hcl_set_from_file_inplace_leaves_file_unchanged", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_get_errors", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_input_parse_errors", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_set_cargo_invalid_json", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_config_routing_more_edges.test_replace_number_token_unrelated_leaf_untouched", + "reasons": [ + { + "id": "short_substring", + "message": "pytest test uses a too-short substring oracle", + "path": "eval/tests/test_config_routing_more_edges.py", + "repair_hint": "Use a longer, specific substring or an exact normalized output comparison.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_config_composition.test_duplicate_raw_flag_accepted", + "eval.tests.test_config_composition.test_get_no_query_errors", + "eval.tests.test_config_composition.test_get_too_many_args_errors", + "eval.tests.test_config_composition.test_in_optional_stdin_used_when_omitted", + "eval.tests.test_config_composition.test_in_out_json_composed", + "eval.tests.test_config_composition.test_in_out_raw_composed", + "eval.tests.test_config_composition.test_keys_raw_prints_unquoted_keys", + "eval.tests.test_config_composition.test_out_file_carries_newline_for_json", + "eval.tests.test_config_composition.test_set_requires_two_args", + "eval.tests.test_config_exact_diagnostics.test_append_one_arg_error_exact", + "eval.tests.test_config_exact_diagnostics.test_get_three_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_keys_two_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_no_command_prints_help_to_stdout", + "eval.tests.test_config_exact_diagnostics.test_prepend_three_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_replace_zero_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_set_three_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_set_zero_args_error_exact", + "eval.tests.test_config_exact_diagnostics.test_version_flag_is_unknown", + "eval.tests.test_config_inplace.test_in_place_append_exact_rewrite", + "eval.tests.test_config_inplace.test_in_place_conflict_leaves_file_unchanged", + "eval.tests.test_config_inplace.test_in_place_conflicts_with_out", + "eval.tests.test_config_inplace.test_in_place_conflicts_with_out_long_forms", + "eval.tests.test_config_inplace.test_in_place_normalizes_to_two_space_indent", + "eval.tests.test_config_inplace.test_in_place_overwrite_and_reget", + "eval.tests.test_config_inplace.test_in_place_prepend_puts_value_first", + "eval.tests.test_config_inplace.test_in_place_scalar_exact_rewrite", + "eval.tests.test_config_inplace.test_in_place_scalar_replaced_via_short_flag", + "eval.tests.test_config_inplace.test_in_place_without_in_errors", + "eval.tests.test_config_inplace.test_in_place_writes_without_trailing_newline", + "eval.tests.test_config_input_file.test_get_reads_input_file", + "eval.tests.test_config_input_file.test_get_reads_nested_file_value", + "eval.tests.test_config_input_file.test_in_directory_errors", + "eval.tests.test_config_input_file.test_in_missing_file_errors", + "eval.tests.test_config_input_file.test_in_reads_testdoc_key", + "eval.tests.test_config_input_file.test_in_reads_testdoc_nested_key", + "eval.tests.test_config_input_file.test_in_uses_file_not_stdin", + "eval.tests.test_config_input_file.test_keys_reads_input_file", + "eval.tests.test_config_input_file.test_set_reads_input_file", + "eval.tests.test_config_input_file.test_set_with_in_does_not_modify_source", + "eval.tests.test_config_output_file.test_get_list_output_file", + "eval.tests.test_config_output_file.test_get_output_file_has_newline", + "eval.tests.test_config_output_file.test_get_output_file_truncates_existing", + "eval.tests.test_config_output_file.test_get_writes_output_file", + "eval.tests.test_config_output_file.test_keys_writes_output_file", + "eval.tests.test_config_output_file.test_out_captures_raw_format", + "eval.tests.test_config_output_file.test_out_to_directory_errors", + "eval.tests.test_config_output_file.test_out_to_nonexistent_directory_errors", + "eval.tests.test_config_output_file.test_set_output_does_not_echo_stdout", + "eval.tests.test_config_output_file.test_set_writes_output_file", + "eval.tests.test_config_raw_output.test_json_default_for_string", + "eval.tests.test_config_raw_output.test_raw_and_json_matrix[v = \"single\"-v-single-\"single\"]", + "eval.tests.test_config_raw_output.test_raw_and_json_matrix[v = 3.5-v-3.5-3.5]", + "eval.tests.test_config_raw_output.test_raw_and_json_matrix[v = [7]-v[]-7-[7]]", + "eval.tests.test_config_raw_output.test_raw_and_json_matrix[v = false-v-false-false]", + "eval.tests.test_config_raw_output.test_raw_bool_unquoted", + "eval.tests.test_config_raw_output.test_raw_list_space_joined", + "eval.tests.test_config_raw_output.test_raw_list_string_items_unquoted", + "eval.tests.test_config_raw_output.test_raw_list_trailing_space_trimmed", + "eval.tests.test_config_raw_output.test_raw_number_unquoted", + "eval.tests.test_config_raw_output.test_raw_scalar_unquoted", + "eval.tests.test_config_raw_output.test_raw_string_with_spaces_preserved", + "eval.tests.test_config_raw_output.test_raw_vs_json_list_differ", + "eval.tests.test_config_replace_limit.test_replace_default_replaces_all", + "eval.tests.test_config_replace_limit.test_replace_n_0_replaces_none", + "eval.tests.test_config_replace_limit.test_replace_n_1_replaces_first_only", + "eval.tests.test_config_replace_limit.test_replace_n_2_replaces_first_two", + "eval.tests.test_config_replace_limit.test_replace_n_exceeding_occurrences", + "eval.tests.test_config_replace_limit.test_replace_n_long_flag_1", + "eval.tests.test_config_replace_limit.test_replace_n_missing_value_errors", + "eval.tests.test_config_replace_limit.test_replace_n_negative_number_all", + "eval.tests.test_config_replace_limit.test_replace_no_occurrence_unchanged", + "eval.tests.test_config_replace_limit.test_replace_prints_stdout_when_not_inplace", + "eval.tests.test_config_routing.test_get_does_not_accept_in_place", + "eval.tests.test_config_routing.test_in_and_out_long_flags", + "eval.tests.test_config_routing.test_in_short_and_long_flags_equivalent", + "eval.tests.test_config_routing.test_modify_causal_inplace_then_readback", + "eval.tests.test_config_routing.test_out_causal_overwrites_prior_output", + "eval.tests.test_config_routing.test_raw_flag_registered_on_get_accepts_short_and_long", + "eval.tests.test_config_routing.test_raw_list_plus_out_and_no_in_uses_stdin", + "eval.tests.test_config_routing.test_set_family_accepts_in_place_all_subcommands", + "eval.tests.test_config_routing.test_set_overwrites_output_without_modifying_input", + "eval.tests.test_config_routing_expanded.test_get_literal_on_list_wrong_type_error", + "eval.tests.test_config_routing_expanded.test_in_list_index_query", + "eval.tests.test_config_routing_expanded.test_in_negative_index_returns_last", + "eval.tests.test_config_routing_expanded.test_in_out_same_file_roundtrip", + "eval.tests.test_config_routing_expanded.test_keys_regex_raw_unquoted", + "eval.tests.test_config_routing_expanded.test_keys_regex_to_output_file", + "eval.tests.test_config_routing_expanded.test_out_raw_regex_matched", + "eval.tests.test_config_routing_expanded.test_out_wildcard_json_list", + "eval.tests.test_config_routing_expanded.test_raw_list_index_unquotes_string", + "eval.tests.test_config_routing_expanded.test_set_json_list_cargo_stdout_exact", + "eval.tests.test_config_routing_expanded.test_set_list_json_cargo_to_out_file", + "eval.tests.test_config_routing_expanded.test_set_literal_on_list_wrong_type_error", + "eval.tests.test_config_routing_expanded.test_wildcard_set_scalar_stdout_exact", + "eval.tests.test_config_routing_more_edges.test_get_list_query_on_literal_reports_requested_list", + "eval.tests.test_config_routing_more_edges.test_hyphenated_key_get_json", + "eval.tests.test_config_routing_more_edges.test_hyphenated_key_get_raw", + "eval.tests.test_config_routing_more_edges.test_hyphenated_key_inplace_round_trip", + "eval.tests.test_config_routing_more_edges.test_hyphenated_key_set_from_stdin", + "eval.tests.test_config_routing_more_edges.test_hypthen_keys_wildcard_lists_all_scalars", + "eval.tests.test_config_routing_more_edges.test_inplace_regex_multi_set_then_read_back_chain", + "eval.tests.test_config_routing_more_edges.test_inplace_replace_no_match_value_unchanged", + "eval.tests.test_config_routing_more_edges.test_keys_wildcard_with_list_element_errors_unexpected_type", + "eval.tests.test_config_routing_more_edges.test_list_query_on_literal_error_via_input_file", + "eval.tests.test_config_routing_more_edges.test_malformed_hcl_from_file_reports_parse_error", + "eval.tests.test_config_routing_more_edges.test_malformed_hcl_from_stdin_reports_parse_error", + "eval.tests.test_config_routing_more_edges.test_malformed_hcl_set_from_file_inplace_leaves_file_unchanged", + "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_get_errors", + "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_input_parse_errors", + "eval.tests.test_config_routing_more_edges.test_out_file_not_created_when_set_cargo_invalid_json", + "eval.tests.test_config_routing_more_edges.test_regex_index_matches_bare_list_query", + "eval.tests.test_config_routing_more_edges.test_regex_list_all_raw_keeps_per_list_brackets", + "eval.tests.test_config_routing_more_edges.test_regex_list_explicit_index_returns_full_lists", + "eval.tests.test_config_routing_more_edges.test_regex_list_index_out_of_bounds_is_ignored", + "eval.tests.test_config_routing_more_edges.test_regex_mix_of_scalar_and_list_returns_combined", + "eval.tests.test_config_routing_more_edges.test_regex_mix_scalar_list_raw_keeps_inner_list_brackets", + "eval.tests.test_config_routing_more_edges.test_replace_number_token_capped", + "eval.tests.test_config_routing_more_edges.test_replace_number_token_empty_old_capped", + "eval.tests.test_config_routing_more_edges.test_replace_number_token_unrelated_leaf_untouched", + "eval.tests.test_config_routing_more_edges.test_set_list_query_on_literal_reports_requested_list", + "eval.tests.test_config_routing_more_edges.test_wildcard_nested_set_writes_stdout_exact", + "eval.tests.test_config_routing_more_edges.test_wildcard_nested_values_json", + "eval.tests.test_config_routing_more_edges.test_wildcard_nested_values_raw", + "eval.tests.test_config_routing_regex_index_edges.test_append_string_cargo_on_scalar", + "eval.tests.test_config_routing_regex_index_edges.test_empty_input_keys", + "eval.tests.test_config_routing_regex_index_edges.test_index_out_of_bounds_negative", + "eval.tests.test_config_routing_regex_index_edges.test_index_out_of_bounds_positive", + "eval.tests.test_config_routing_regex_index_edges.test_index_out_of_bounds_via_input_file", + "eval.tests.test_config_routing_regex_index_edges.test_invalid_regex_get_errors", + "eval.tests.test_config_routing_regex_index_edges.test_keys_all_to_output_file", + "eval.tests.test_config_routing_regex_index_edges.test_keys_on_literal_raw_bracket_list", + "eval.tests.test_config_routing_regex_index_edges.test_keys_on_literal_returns_the_key", + "eval.tests.test_config_routing_regex_index_edges.test_keys_single_to_output_file", + "eval.tests.test_config_routing_regex_index_edges.test_missing_key_get_writes_empty_list_to_file", + "eval.tests.test_config_routing_regex_index_edges.test_negative_index_back_from_end", + "eval.tests.test_config_routing_regex_index_edges.test_negative_index_string_raw_unquoted", + "eval.tests.test_config_routing_regex_index_edges.test_regex_keys_single_match", + "eval.tests.test_config_routing_regex_index_edges.test_regex_list_multi_match_all_items", + "eval.tests.test_config_routing_regex_index_edges.test_regex_target_set_inplace_then_readback_chain", + "eval.tests.test_config_routing_regex_index_edges.test_regex_target_set_stdout_exact", + "eval.tests.test_config_routing_regex_index_edges.test_replace_empty_old_sequence_inserts_everywhere", + "eval.tests.test_config_routing_regex_index_edges.test_replace_stdout_no_trailing_newline", + "eval.tests.test_config_routing_regex_index_edges.test_set_json_list_cargo_on_scalar", + "eval.tests.test_config_routing_regex_index_edges.test_set_json_object_cargo_on_scalar", + "eval.tests.test_config_routing_regex_index_edges.test_wildcard_set_on_list_errors", + "eval.tests.test_config_set_family_edges.test_append_empty_list_in_place_exact", + "eval.tests.test_config_set_family_edges.test_append_list_reads_in_file_writes_out_file", + "eval.tests.test_config_set_family_edges.test_append_string_in_place_exact", + "eval.tests.test_config_set_family_edges.test_empty_input_file_get_returns_empty_list", + "eval.tests.test_config_set_family_edges.test_get_missing_key_returns_empty_list", + "eval.tests.test_config_set_family_edges.test_in_place_bool_cargo_stored_quoted", + "eval.tests.test_config_set_family_edges.test_in_place_causal_append_then_replace_chain", + "eval.tests.test_config_set_family_edges.test_in_place_float_cargo_stored_quoted", + "eval.tests.test_config_set_family_edges.test_keys_no_match_returns_empty_list", + "eval.tests.test_config_set_family_edges.test_prepend_string_in_place_exact", + "eval.tests.test_config_set_family_edges.test_replace_default_replaces_all_out_stdout", + "eval.tests.test_config_set_family_edges.test_replace_reads_in_file_writes_out_file", + "eval.tests.test_config_set_family_edges.test_replace_string_in_place_capped_exact", + "eval.tests.test_config_set_family_edges.test_set_boolean_cargo_stored_as_string", + "eval.tests.test_config_set_family_edges.test_set_empty_string_cargo_stdout", + "eval.tests.test_config_set_family_edges.test_set_list_json_cargo_in_place_exact", + "eval.tests.test_config_set_family_edges.test_set_number_cargo_always_quoted" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_coverage_gaps.TestEmptyListBoundaries.test_empty_list_index_out_of_bounds", + "eval.tests.test_coverage_gaps.TestKeysOutputVariants.test_keys_nested_nonexistent", + "eval.tests.test_coverage_gaps.TestKeysOutputVariants.test_keys_no_match_empty_list", + "eval.tests.test_coverage_gaps.TestKeysOutputVariants.test_keys_raw_space_joined", + "eval.tests.test_coverage_gaps.TestListCrumbMidQuery.test_get_list_crumb_followed_by_path_errors[alpha[0].x]", + "eval.tests.test_coverage_gaps.TestListCrumbMidQuery.test_get_list_crumb_followed_by_path_errors[alpha[].x]", + "eval.tests.test_coverage_gaps.TestListCrumbMidQuery.test_get_list_crumb_followed_by_path_errors[beta-list[0].y]", + "eval.tests.test_coverage_gaps.TestListCrumbMidQuery.test_keys_list_crumb_followed_by_path_errors", + "eval.tests.test_coverage_gaps.TestListCrumbMidQuery.test_set_list_crumb_followed_by_path_errors", + "eval.tests.test_coverage_gaps.TestRawScalarPath.test_get_nonexistent_top_level", + "eval.tests.test_coverage_gaps.TestRawScalarPath.test_raw_single_scalar_via_list_index", + "eval.tests.test_coverage_gaps.TestRegexIndexer.test_regex_all_items_bracket_on_scalar", + "eval.tests.test_coverage_gaps.TestRegexIndexer.test_regex_bracket_index_ignored_on_scalar", + "eval.tests.test_coverage_gaps.TestRegexIndexer.test_regex_numeric_pattern_list_out_of_bounds", + "eval.tests.test_coverage_gaps.TestRegexIndexer.test_regex_numeric_pattern_matches_multiple_lists", + "eval.tests.test_coverage_gaps.TestRegexListCrossWildcard.test_keys_nested_indexed_list", + "eval.tests.test_coverage_gaps.TestRegexListCrossWildcard.test_keys_wildcard_indexed_list", + "eval.tests.test_coverage_gaps.TestRegexListCrossWildcard.test_regex_path_to_all_lists_cross_wildcard", + "eval.tests.test_coverage_gaps.TestRegexListCrossWildcard.test_regex_path_to_lists_cross_wildcard", + "eval.tests.test_coverage_gaps.TestSetBulkListRewrite.test_set_append_to_indexed_list", + "eval.tests.test_coverage_gaps.TestSetBulkListRewrite.test_set_wildcard_all_list_replaces_each", + "eval.tests.test_coverage_gaps.TestSetBulkListRewrite.test_set_wildcard_indexed_list_replaces_whole_list", + "eval.tests.test_coverage_gaps.TestWildcardReachingList.test_wildcard_all_items_is_type_error", + "eval.tests.test_coverage_gaps.TestWildcardReachingList.test_wildcard_index_is_type_error", + "eval.tests.test_crumb_combinations.TestHyphenAndNumericKeys.test_hyphenated_key_keys_output", + "eval.tests.test_crumb_combinations.TestHyphenAndNumericKeys.test_hyphenated_key_with_list_index", + "eval.tests.test_crumb_combinations.TestHyphenAndNumericKeys.test_numeric_top_level_key_hcl_parse_error", + "eval.tests.test_crumb_combinations.TestKeysWildcardNested.test_keys_on_wildcard_nested_path", + "eval.tests.test_crumb_combinations.TestListSetAsymmetry.test_append_array_to_list_as_nested_element", + "eval.tests.test_crumb_combinations.TestListSetAsymmetry.test_prepend_array_to_list_flattens_elements", + "eval.tests.test_crumb_combinations.TestNestedNegativeIndex.test_nested_list_negative_wraparound", + "eval.tests.test_crumb_combinations.TestRegexLiteralListIndex.test_regex_then_literal_then_list_index", + "eval.tests.test_crumb_combinations.TestRegexLiteralListIndex.test_regex_wildcard_literal_list_index", + "eval.tests.test_crumb_combinations.TestReplaceOccurrenceBoundary.test_replace_limited_occurrence_count", + "eval.tests.test_crumb_combinations.TestSetCrumbTargets.test_set_regex_targets_only_matching_sibling", + "eval.tests.test_crumb_combinations.TestSetCrumbTargets.test_set_wildcard_indexed_list_to_zero", + "eval.tests.test_crumb_combinations.TestSetCrumbTargets.test_set_wildcard_nested_scalar_rewrites_each", + "eval.tests.test_crumb_combinations.TestWildcardNestedStructures.test_double_wildcard_descends_two_levels", + "eval.tests.test_crumb_combinations.TestWildcardNestedStructures.test_wildcard_nested_object_to_list_index", + "eval.tests.test_crumb_combinations.TestWildcardNestedStructures.test_wildcard_raw_scalar_set", + "eval.tests.test_errors.TestArgValidation.test_get_extra_args_exact_message", + "eval.tests.test_errors.TestArgValidation.test_get_keys_zero_args_exact_message", + "eval.tests.test_errors.TestArgValidation.test_get_zero_args_exact_message", + "eval.tests.test_errors.TestArgValidation.test_set_requires_two_args", + "eval.tests.test_errors.TestArgValidation.test_unknown_command_errors", + "eval.tests.test_errors.TestBadHCLInput.test_malformed_hcl_errors_exact_diagnostic", + "eval.tests.test_errors.TestBadHCLInput.test_missing_input_file_errors", + "eval.tests.test_errors.TestEmptyQueryPanic.test_zero_crumb_query_panics[()]", + "eval.tests.test_errors.TestEmptyQueryPanic.test_zero_crumb_query_panics[...]", + "eval.tests.test_errors.TestEmptyQueryPanic.test_zero_crumb_query_panics[.]", + "eval.tests.test_errors.TestEmptyQueryPanic.test_zero_crumb_query_panics[[1]]", + "eval.tests.test_errors.TestEmptyQueryPanic.test_zero_crumb_query_panics[]", + "eval.tests.test_errors.TestHelpPaths.test_get_help_lists_keys_subcommand_and_raw_flag", + "eval.tests.test_errors.TestHelpPaths.test_root_help_documents_grammar", + "eval.tests.test_errors.TestHelpPaths.test_root_help_lists_subcommands_and_modify_note", + "eval.tests.test_errors.TestHelpPaths.test_set_help_documents_append_prepend_replace", + "eval.tests.test_list.TestListAcrossObjects.test_all_items_across_objects", + "eval.tests.test_list.TestListAcrossObjects.test_indexed_list_across_wildcard", + "eval.tests.test_list.TestListAcrossObjects.test_list_nested_indexed", + "eval.tests.test_list.TestListAllItems.test_empty_list_all_items", + "eval.tests.test_list.TestListAllItems.test_get_all_items[alpha-[10,20,30]]", + "eval.tests.test_list.TestListAllItems.test_get_all_items[beta-[\"a\",\"b\"]]", + "eval.tests.test_list.TestListAllItems.test_list_mismatched_key", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[-1-30]", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[-2-20]", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[-3-10]", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[0-10]", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[1-20]", + "eval.tests.test_list.TestListIndex.test_index_and_negative_wraparound[2-30]", + "eval.tests.test_list.TestListIndex.test_index_zero_based", + "eval.tests.test_list.TestListIndex.test_out_of_bounds[-4-index -1 out of bounds]", + "eval.tests.test_list.TestListIndex.test_out_of_bounds[5-index 5 out of bounds]", + "eval.tests.test_list.TestListIndex.test_out_of_bounds[99-index 99 out of bounds]", + "eval.tests.test_list.TestListRaw.test_raw_all_items", + "eval.tests.test_list.TestListRaw.test_raw_indexed_scalar", + "eval.tests.test_list.TestListTypeGuard.test_list_queried_as_literal", + "eval.tests.test_list.TestListTypeGuard.test_literal_queried_as_list", + "eval.tests.test_literal.TestLiteralKeyOutput.test_keys_on_no_match_is_empty_list", + "eval.tests.test_literal.TestLiteralKeyOutput.test_keys_subcommand_lists_full_paths", + "eval.tests.test_literal.TestLiteralKeyOutput.test_raw_single_value", + "eval.tests.test_literal.TestLiteralMatch.test_block_path_literals[data.x.y-[]]", + "eval.tests.test_literal.TestLiteralMatch.test_block_path_literals[data.x.y.id-\"100\"]", + "eval.tests.test_literal.TestLiteralMatch.test_block_path_literals[data.x.y.name-\"abc\"]", + "eval.tests.test_literal.TestLiteralMatch.test_exact_literal[id-\"100\"]", + "eval.tests.test_literal.TestLiteralMatch.test_exact_literal[name-\"abc\"]", + "eval.tests.test_literal.TestLiteralMatch.test_hyphenated_key[some-key-\"kval\"]", + "eval.tests.test_literal.TestLiteralMatch.test_hyphenated_key[sub-key.t-1]", + "eval.tests.test_literal.TestLiteralMatch.test_nested_literals[outer.inner-[]]", + "eval.tests.test_literal.TestLiteralMatch.test_nested_literals[outer.inner.leaf-\"deep\"]", + "eval.tests.test_literal.TestLiteralMatch.test_nested_literals[outer.nonexistent-[]]", + "eval.tests.test_literal.TestLiteralMatch.test_nested_literals[outer.other-\"hi\"]", + "eval.tests.test_literal.TestLiteralMatch.test_scalar_types[a-true]", + "eval.tests.test_literal.TestLiteralMatch.test_scalar_types[b-123]", + "eval.tests.test_literal.TestLiteralMatch.test_scalar_types[c-1.5]", + "eval.tests.test_literal.TestLiteralMatch.test_scalar_types[d-\"str\"]", + "eval.tests.test_literal.TestLiteralMismatch.test_case_sensitive_match", + "eval.tests.test_literal.TestLiteralMismatch.test_multiple_results_returned_as_list", + "eval.tests.test_parse_edges.TestCrumbGrouping.test_index_on_scalar_is_list_type_error", + "eval.tests.test_parse_edges.TestCrumbGrouping.test_list_suffix_is_one_crumb", + "eval.tests.test_parse_edges.TestCrumbGrouping.test_stray_brackets_yield_no_crumb_and_panic", + "eval.tests.test_parse_edges.TestEmptySegments.test_dot_separators_ignored_resolve_to_alpha[..alpha]", + "eval.tests.test_parse_edges.TestEmptySegments.test_dot_separators_ignored_resolve_to_alpha[.alpha]", + "eval.tests.test_parse_edges.TestEmptySegments.test_dot_separators_ignored_resolve_to_alpha[alpha...]", + "eval.tests.test_parse_edges.TestEmptySegments.test_dot_separators_ignored_resolve_to_alpha[alpha..]", + "eval.tests.test_parse_edges.TestEmptySegments.test_dot_separators_ignored_resolve_to_alpha[alpha.]", + "eval.tests.test_parse_edges.TestEmptySegments.test_dots_on_both_ends_resolve_nested", + "eval.tests.test_parse_edges.TestHyphenatedKeys.test_hyphen_in_identifier[beta-list[0]-1]", + "eval.tests.test_parse_edges.TestHyphenatedKeys.test_hyphen_in_identifier[beta-list[]-[1,2]]", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_quotes_across_path[\"outer.inner\"]", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_quotes_across_path['outer.inner']", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_surrounding_quotes[\"alpha\"]", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_surrounding_quotes[\"alpha]", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_surrounding_quotes['alpha']", + "eval.tests.test_parse_edges.TestQuoteTrimming.test_trim_surrounding_quotes[alpha\"]", + "eval.tests.test_parse_edges.TestTrailingCrumbIgnored.test_multiple_dots_only_query_panics", + "eval.tests.test_parse_edges.TestTrailingCrumbIgnored.test_trailing_crumb_after_cross_object_scalars", + "eval.tests.test_parse_edges.TestTrailingCrumbIgnored.test_trailing_crumb_after_scalar_preserves_value", + "eval.tests.test_regex.TestRegexEscapes.test_escaped_slash_does_not_match_plain", + "eval.tests.test_regex.TestRegexEscapes.test_escaped_slash_parses_without_separating", + "eval.tests.test_regex.TestRegexInvalid.test_invalid_regex_is_parse_error[/(/-missing closing )]", + "eval.tests.test_regex.TestRegexInvalid.test_invalid_regex_is_parse_error[/[/-missing closing ]]", + "eval.tests.test_regex.TestRegexList.test_regex_all_items_on_list", + "eval.tests.test_regex.TestRegexList.test_regex_mixed_path_over_list", + "eval.tests.test_regex.TestRegexList.test_regex_numeric_pattern_index_bug", + "eval.tests.test_regex.TestRegexList.test_regex_numeric_pattern_scalar_ok", + "eval.tests.test_regex.TestRegexMatch.test_regex_keys", + "eval.tests.test_regex.TestRegexMatch.test_regex_matches_key[/^a/-\"red\"]", + "eval.tests.test_regex.TestRegexMatch.test_regex_matches_key[/^b/-\"yellow\"]", + "eval.tests.test_regex.TestRegexMatch.test_regex_matches_key[/an/-\"yellow\"]", + "eval.tests.test_regex.TestRegexMatch.test_regex_matches_key[/err/-\"red\"]", + "eval.tests.test_regex.TestRegexMatch.test_regex_no_match_returns_empty", + "eval.tests.test_regex.TestRegexMatch.test_regex_with_path_after", + "eval.tests.test_set.TestAppendPrepend.test_append_to_list", + "eval.tests.test_set.TestAppendPrepend.test_append_to_string", + "eval.tests.test_set.TestAppendPrepend.test_prepend_to_list", + "eval.tests.test_set.TestAppendPrepend.test_prepend_to_string", + "eval.tests.test_set.TestSetConfigIo.test_get_input_file", + "eval.tests.test_set.TestSetConfigIo.test_get_output_file", + "eval.tests.test_set.TestSetConfigIo.test_set_in_place_writes_input_file", + "eval.tests.test_set.TestSetConfigIo.test_set_modify_and_out_conflict", + "eval.tests.test_set.TestSetConfigIo.test_set_modify_requires_input_file", + "eval.tests.test_set.TestSetConfigIo.test_set_output_file_writes_hcl", + "eval.tests.test_set.TestSetLiteral.test_set_indexed_item_requires_list_value", + "eval.tests.test_set.TestSetLiteral.test_set_list_all_items_replaces_list", + "eval.tests.test_set.TestSetLiteral.test_set_literal_crumb_exact", + "eval.tests.test_set.TestSetLiteral.test_set_number_value_written_as_string", + "eval.tests.test_set.TestSetLiteral.test_set_wildcard_rewrites_each_match", + "eval.tests.test_set.TestSetReplace.test_replace_on_list_rejected_as_literal_only", + "eval.tests.test_set.TestSetReplace.test_replace_string_all", + "eval.tests.test_set.TestSetReplace.test_replace_string_limited_occurrences", + "eval.tests.test_wildcard.TestWildcard.test_standalone_wildcard_returns_leaves", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_in_middle_path", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_keys_reports_matches[*-[\"a.v\",\"b.v\"]]", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_keys_reports_matches[*.v-[\"a.v\",\"b.v\"]]", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_keys_reports_matches[a.*-[\"a.v\"]]", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_matches_comma_all", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_matches_scalars_too", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_raw_output", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_reaching_list_is_type_error", + "eval.tests.test_wildcard.TestWildcard.test_wildcard_reaching_list_with_path", + "eval.tests.test_wildcard.TestWildcardCombined.test_wildcard_and_literal", + "eval.tests.test_wildcard.TestWildcardCombined.test_wildcard_with_indexed_list" + ] + }, + "generated_module_04": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli.test_append_help_output_exact", + "eval.tests.test_cli.test_existing_keys_subcommand_under_get", + "eval.tests.test_cli.test_get_help_output_exact", + "eval.tests.test_cli.test_get_rejects_two_args", + "eval.tests.test_cli.test_get_requires_exactly_one_arg", + "eval.tests.test_cli.test_keys_help_output_exact", + "eval.tests.test_cli.test_no_args_prints_same_help_as_help_flag", + "eval.tests.test_cli.test_replace_rejects_four_args", + "eval.tests.test_cli.test_replace_requires_three_args", + "eval.tests.test_cli.test_root_help_output_exact", + "eval.tests.test_cli.test_set_accepts_two_args_not_three", + "eval.tests.test_cli.test_set_help_output_exact", + "eval.tests.test_cli.test_set_requires_two_args", + "eval.tests.test_cli.test_unknown_command_rejected", + "eval.tests.test_cli.test_unknown_subcommand_word_under_get_treated_as_query", + "eval.tests.test_cli.test_version_flag_rejected", + "eval.tests.test_cli.test_version_subcommand_rejected", + "eval.tests.test_document.test_append_round_trip_then_get", + "eval.tests.test_document.test_get_from_invalid_file_errors", + "eval.tests.test_document.test_get_from_real_file_resource", + "eval.tests.test_document.test_get_from_unclosed_block_file_errors", + "eval.tests.test_document.test_set_multiple_wildcard_prints_all_matching_blocks", + "eval.tests.test_document.test_set_prints_full_document_and_preserves_other_keys", + "eval.tests.test_document.test_set_prints_three_key_document_in_order", + "eval.tests.test_document.test_set_round_trip_preserves_object_blocks", + "eval.tests.test_document.test_set_then_get_stateful_chain", + "eval.tests.test_get_basic.test_get_bool_false_returned_as_json_bool", + "eval.tests.test_get_basic.test_get_bool_true_returned_as_json_bool", + "eval.tests.test_get_basic.test_get_dash_key", + "eval.tests.test_get_basic.test_get_deep_nested_object_value", + "eval.tests.test_get_basic.test_get_float_returned_as_json_number", + "eval.tests.test_get_basic.test_get_hex_integer_literal", + "eval.tests.test_get_basic.test_get_integer_returned_as_json_number", + "eval.tests.test_get_basic.test_get_nested_object_bool", + "eval.tests.test_get_basic.test_get_nested_object_value", + "eval.tests.test_get_basic.test_get_raw_integer_trims_quotes", + "eval.tests.test_get_basic.test_get_raw_string_strips_quotes", + "eval.tests.test_get_basic.test_get_single_result_is_scalar_not_array", + "eval.tests.test_get_basic.test_get_single_vs_many_top_level_keys", + "eval.tests.test_get_basic.test_get_string_returned_as_json_string", + "eval.tests.test_get_basic.test_get_trailing_newline_present", + "eval.tests.test_get_basic.test_get_underscore_key", + "eval.tests.test_get_errors.test_get_block_name_alone_yields_empty", + "eval.tests.test_get_errors.test_get_empty_query_panics_with_out_of_range", + "eval.tests.test_get_errors.test_get_from_missing_input_file_errors", + "eval.tests.test_get_errors.test_get_index_on_empty_document_returns_empty", + "eval.tests.test_get_errors.test_get_index_on_empty_list_errors", + "eval.tests.test_get_errors.test_get_index_out_of_bounds_large_positive", + "eval.tests.test_get_errors.test_get_index_out_of_bounds_negative", + "eval.tests.test_get_errors.test_get_index_out_of_bounds_positive", + "eval.tests.test_get_errors.test_get_invalid_hcl_errors", + "eval.tests.test_get_errors.test_get_missing_key_returns_empty_array", + "eval.tests.test_get_errors.test_get_missing_nested_key_returns_empty_array", + "eval.tests.test_get_errors.test_get_unbalanced_braces_errors", + "eval.tests.test_get_errors.test_get_wrong_dotted_first_segment_empty", + "eval.tests.test_get_errors.test_get_wrong_type_key_on_list_errors", + "eval.tests.test_get_keys.test_keys_list_query_reports_object_key", + "eval.tests.test_get_keys.test_keys_multiple_matches_wildcard", + "eval.tests.test_get_keys.test_keys_nested_object_path", + "eval.tests.test_get_keys.test_keys_no_match_empty_array", + "eval.tests.test_get_keys.test_keys_raw_format", + "eval.tests.test_get_keys.test_keys_second_top_level_key_isolated", + "eval.tests.test_get_keys.test_keys_single_literal", + "eval.tests.test_get_lists.test_get_empty_list_all_items", + "eval.tests.test_get_lists.test_get_list_all_items_json", + "eval.tests.test_get_lists.test_get_list_all_items_raw", + "eval.tests.test_get_lists.test_get_list_first_index", + "eval.tests.test_get_lists.test_get_list_last_index", + "eval.tests.test_get_lists.test_get_list_middle_index", + "eval.tests.test_get_lists.test_get_list_mixed_types_json", + "eval.tests.test_get_lists.test_get_list_negative_one_wraps_to_last", + "eval.tests.test_get_lists.test_get_list_negative_two", + "eval.tests.test_get_lists.test_get_list_of_strings_raw_keeps_spaces", + "eval.tests.test_get_lists.test_get_list_string_index", + "eval.tests.test_get_lists.test_get_list_string_index_raw", + "eval.tests.test_get_lists.test_get_nested_list_in_object", + "eval.tests.test_get_lists.test_get_nested_list_specific_index", + "eval.tests.test_get_matching.test_get_keys_of_multiple_lists_via_wildcard", + "eval.tests.test_get_matching.test_get_multi_match_same_key_objects", + "eval.tests.test_get_matching.test_get_object_item_with_multiple_label_keys", + "eval.tests.test_get_matching.test_get_regex_anchored", + "eval.tests.test_get_matching.test_get_regex_dash_keys", + "eval.tests.test_get_matching.test_get_regex_list_all", + "eval.tests.test_get_matching.test_get_regex_matches_all_keys", + "eval.tests.test_get_matching.test_get_specific_index_across_objects", + "eval.tests.test_get_matching.test_get_wildcard_combines_values", + "eval.tests.test_get_matching.test_get_wildcard_matches_any_key_at_position", + "eval.tests.test_get_matching.test_get_wildcard_numeric_values", + "eval.tests.test_get_matching.test_get_wildcard_raw_combines", + "eval.tests.test_in_place.test_in_place_append_to_list_file", + "eval.tests.test_in_place.test_in_place_conflicts_with_out", + "eval.tests.test_in_place.test_in_place_edits_file", + "eval.tests.test_in_place.test_in_place_requires_input_file", + "eval.tests.test_in_place.test_in_place_sets_multiple_matches", + "eval.tests.test_in_place.test_in_place_with_nested_query", + "eval.tests.test_io.test_in_and_out_combined", + "eval.tests.test_io.test_input_file_flag_reads_file", + "eval.tests.test_io.test_input_file_resource_has_expected_values", + "eval.tests.test_io.test_output_file_error_on_bad_directory", + "eval.tests.test_io.test_output_file_is_overwritten_when_exists", + "eval.tests.test_io.test_output_file_with_get_keys", + "eval.tests.test_io.test_output_file_writes_stdout_content_to_disk", + "eval.tests.test_io.test_raw_output_changes_string_format", + "eval.tests.test_io.test_stdin_reads_document", + "eval.tests.test_json_convert.test_set_invalid_json_empty_string_errors", + "eval.tests.test_json_convert.test_set_json_array_of_objects_yields_not_a_list", + "eval.tests.test_json_convert.test_set_json_float_array_keeps_decimal", + "eval.tests.test_json_convert.test_set_json_with_spaces_preserved", + "eval.tests.test_json_convert.test_set_list_json_array_accepts_numbers", + "eval.tests.test_json_convert.test_set_list_json_array_accepts_strings", + "eval.tests.test_json_convert.test_set_list_json_number_is_rejected", + "eval.tests.test_json_convert.test_set_list_json_object_value_is_rejected", + "eval.tests.test_json_convert.test_set_object_target_json_nested", + "eval.tests.test_query_edge.test_get_all_items_of_list_of_lists_is_empty", + "eval.tests.test_query_edge.test_get_all_items_of_list_of_objects_is_empty", + "eval.tests.test_query_edge.test_get_double_wildcard_reaches_list_yields_unexpected_query_type", + "eval.tests.test_query_edge.test_get_double_wildcard_through_block_label", + "eval.tests.test_query_edge.test_get_index_on_list_of_lists_is_empty", + "eval.tests.test_query_edge.test_get_list_wildcard_aggregates_all_lists", + "eval.tests.test_query_edge.test_get_negative_index_on_empty_list_errors", + "eval.tests.test_query_edge.test_get_string_element_in_mixed_list_by_index", + "eval.tests.test_query_edge.test_get_wildcard_aggregates_block_leaf_values", + "eval.tests.test_query_edge.test_get_wildcard_key_on_absent_leaf_is_empty", + "eval.tests.test_query_edge.test_get_wildcard_lists_aggregate_nested_arrays", + "eval.tests.test_query_edge.test_get_wildcard_lists_aggregate_nested_arrays_raw", + "eval.tests.test_query_edge.test_get_wildcard_multiple_scalars_returns_array", + "eval.tests.test_query_edge.test_get_wildcard_on_list_yields_unexpected_query_type", + "eval.tests.test_query_edge.test_get_wildcard_single_scalar_returns_value", + "eval.tests.test_query_edge.test_keys_list_wildcard_reports_object_paths", + "eval.tests.test_query_edge.test_keys_regex_matches_key_names", + "eval.tests.test_query_edge.test_keys_wildcard_reports_block_subtree_paths", + "eval.tests.test_query_edge.test_keys_wildcard_returns_all_top_level_names", + "eval.tests.test_query_set_edges.test_append_wildcard_appends_to_all_lists", + "eval.tests.test_query_set_edges.test_get_indexed_list_of_objects_is_empty", + "eval.tests.test_query_set_edges.test_keys_wrong_type_key_list_errors", + "eval.tests.test_query_set_edges.test_prepend_to_scalar_string_concatenates", + "eval.tests.test_query_set_edges.test_replace_on_list_panics", + "eval.tests.test_query_set_edges.test_set_wildcard_replaces_all_matching_lists", + "eval.tests.test_query_set_edges.test_set_wrong_type_key_list_errors", + "eval.tests.test_query_set_edges.test_set_wrong_type_wildcard_matching_list_errors", + "eval.tests.test_ready_new_edges.test_append_list_syntax_on_scalar_literal_errors", + "eval.tests.test_ready_new_edges.test_append_on_object_target_is_silent_noop", + "eval.tests.test_ready_new_edges.test_append_via_regex_index_ignores_index_and_appends", + "eval.tests.test_ready_new_edges.test_get_all_items_syntax_on_scalar_scalar_literal", + "eval.tests.test_ready_new_edges.test_get_index_syntax_on_scalar_literal", + "eval.tests.test_ready_new_edges.test_get_invalid_regex_missing_bracket_errors", + "eval.tests.test_ready_new_edges.test_get_invalid_regex_missing_paren_errors", + "eval.tests.test_ready_new_edges.test_get_invalid_regex_multichar_class_errors", + "eval.tests.test_ready_new_edges.test_get_list_syntax_on_nested_scalar_inside_object", + "eval.tests.test_ready_new_edges.test_get_list_syntax_on_object_value", + "eval.tests.test_ready_new_edges.test_get_regex_index_zero_returns_all_items", + "eval.tests.test_ready_new_edges.test_get_regex_mid_index_returns_all_items", + "eval.tests.test_ready_new_edges.test_get_regex_negative_index_returns_all_items", + "eval.tests.test_ready_new_edges.test_get_unclosed_regex_crumb_panics", + "eval.tests.test_ready_new_edges.test_keys_list_syntax_on_object_value_errors", + "eval.tests.test_ready_new_edges.test_keys_list_syntax_on_scalar_literal_errors", + "eval.tests.test_ready_new_edges.test_prepend_on_object_target_is_silent_noop", + "eval.tests.test_ready_new_edges.test_replace_on_object_target_is_silent_noop", + "eval.tests.test_ready_new_edges.test_set_list_syntax_on_object_value_errors", + "eval.tests.test_ready_new_edges.test_set_list_syntax_on_scalar_literal_errors", + "eval.tests.test_ready_new_edges.test_set_regex_list_syntax_on_scalar_quotes_new_value", + "eval.tests.test_ready_new_edges.test_set_regex_mutates_every_matching_scalar_literal", + "eval.tests.test_resources_consume.test_example_tf_queries_fields", + "eval.tests.test_resources_consume.test_example_tf_resource_numeric_list_index", + "eval.tests.test_resources_consume.test_example_tf_wildcard_across_data", + "eval.tests.test_resources_consume.test_testdoc_hcl_deep_object", + "eval.tests.test_resources_consume.test_testdoc_hcl_labeled_object", + "eval.tests.test_resources_consume.test_testdoc_hcl_list_and_empty", + "eval.tests.test_set.test_set_assigned_object_key", + "eval.tests.test_set.test_set_boolean_value_quoted", + "eval.tests.test_set.test_set_dash_prefixed_value_treated_as_flag", + "eval.tests.test_set.test_set_float_value_quoted", + "eval.tests.test_set.test_set_hex_value_quoted", + "eval.tests.test_set.test_set_integer_input_is_quoted_when_literal", + "eval.tests.test_set.test_set_invalid_json_reports_error", + "eval.tests.test_set.test_set_list_with_json_array", + "eval.tests.test_set.test_set_literal_changes_value", + "eval.tests.test_set.test_set_multiple_matches_via_wildcard", + "eval.tests.test_set.test_set_nested_literal", + "eval.tests.test_set.test_set_object_target_with_object_json_is_noop", + "eval.tests.test_set.test_set_preserves_key_and_prints_document", + "eval.tests.test_set.test_set_string_with_quotes_inside", + "eval.tests.test_set.test_set_with_missing_query_match_is_noop", + "eval.tests.test_set_list_ops.test_append_json_list_nests_list", + "eval.tests.test_set_list_ops.test_append_json_string_to_list", + "eval.tests.test_set_list_ops.test_append_keeps_original_then_new", + "eval.tests.test_set_list_ops.test_append_multiple_items_in_succession", + "eval.tests.test_set_list_ops.test_append_object_to_list", + "eval.tests.test_set_list_ops.test_append_scalar_to_list", + "eval.tests.test_set_list_ops.test_append_to_empty_list", + "eval.tests.test_set_list_ops.test_append_to_scalar_string_concatenates", + "eval.tests.test_set_list_ops.test_prepend_list_to_list", + "eval.tests.test_set_list_ops.test_prepend_object_to_list_panics", + "eval.tests.test_set_list_ops.test_prepend_preserves_order", + "eval.tests.test_set_list_ops.test_prepend_scalar_to_list_panics", + "eval.tests.test_set_list_ops.test_prepend_to_empty_list", + "eval.tests.test_set_list_ops.test_replace_absent_sequence_is_noop", + "eval.tests.test_set_list_ops.test_replace_all_by_limit_negative_default", + "eval.tests.test_set_list_ops.test_replace_occurs_on_string", + "eval.tests.test_set_list_ops.test_replace_with_limit_n" + ] + } + }, + "commit": "5b31af0dc21001c2ac770c1bea142b0e2ca0ef56", + "data_source": "synthetic_programgym", + "difficulty": "", + "difficulty_score": null, + "eval_clean_hashes": [ + "ba98b9ae5fcea317b81761df0a68770039a01681c9d4a5c87d10cb7a8db7467e" + ], + "input_record": { + "commit": "5b31af0dc21001c2ac770c1bea142b0e2ca0ef56", + "commits": 167, + "contributors": 2, + "difficulty": "easy", + "difficulty_code_lines": 1001, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 1001, + "difficulty_runtime_deps": 8, + "difficulty_score": 1.9546765869186435, + "difficulty_test_code_lines": 71, + "full_name": "mattolenik/hclq", + "github_stars": 261, + "input_joern_zip": "go_joern/mattolenik__hclq.zip", + "joern_status": true, + "joern_time": 65.65065582306124, + "language": "go", + "pb_match": [ + { + "pb_fullname": "segmentio/chamber", + "rank": 203, + "similarity": 0.5530608892440796 + }, + { + "pb_fullname": "sclevine/yj", + "rank": 42, + "similarity": 0.5663896799087524 + }, + { + "pb_fullname": "antonmedv/walk", + "rank": 305, + "similarity": 0.5120834112167358 + }, + { + "pb_fullname": "peco/peco", + "rank": 31, + "similarity": 0.5738222599029541 + }, + { + "pb_fullname": "mikefarah/yq", + "rank": 24, + "similarity": 0.6381239891052246 + }, + { + "pb_fullname": "rs/curlie", + "rank": 578, + "similarity": 0.49650871753692627 + }, + { + "pb_fullname": "johnkerl/miller", + "rank": 59, + "similarity": 0.5516566038131714 + }, + { + "pb_fullname": "guumaster/hostctl", + "rank": 136, + "similarity": 0.497526615858078 + }, + { + "pb_fullname": "direnv/direnv", + "rank": 445, + "similarity": 0.4319813847541809 + }, + { + "pb_fullname": "JohannesKaufmann/html-to-markdown", + "rank": 618, + "similarity": 0.4821731150150299 + }, + { + "pb_fullname": "jesseduffield/lazygit", + "rank": 762, + "similarity": 0.49623793363571167 + }, + { + "pb_fullname": "FiloSottile/age", + "rank": 568, + "similarity": 0.46905678510665894 + }, + { + "pb_fullname": "boyter/scc", + "rank": 385, + "similarity": 0.5230568647384644 + }, + { + "pb_fullname": "multiprocessio/dsq", + "rank": 650, + "similarity": 0.4718194603919983 + }, + { + "pb_fullname": "noborus/trdsql", + "rank": 269, + "similarity": 0.5298557281494141 + }, + { + "pb_fullname": "noborus/ov", + "rank": 241, + "similarity": 0.5480393171310425 + }, + { + "pb_fullname": "sibprogrammer/xq", + "rank": 594, + "similarity": 0.48776528239250183 + }, + { + "pb_fullname": "kyoh86/richgo", + "rank": 799, + "similarity": 0.499847948551178 + }, + { + "pb_fullname": "eliukblau/pixterm", + "rank": 707, + "similarity": 0.5009673833847046 + }, + { + "pb_fullname": "cheat/cheat", + "rank": 377, + "similarity": 0.5261869430541992 + }, + { + "pb_fullname": "ariga/atlas", + "rank": 804, + "similarity": 0.498232901096344 + }, + { + "pb_fullname": "antonmedv/fx", + "rank": 48, + "similarity": 0.5776000618934631 + }, + { + "pb_fullname": "dundee/gdu", + "rank": 613, + "similarity": 0.49389398097991943 + }, + { + "pb_fullname": "tomnomnom/gron", + "rank": 153, + "similarity": 0.5298125743865967 + }, + { + "pb_fullname": "hairyhenderson/gomplate", + "rank": 497, + "similarity": 0.5263964533805847 + }, + { + "pb_fullname": "junegunn/fzf", + "rank": 86, + "similarity": 0.547595202922821 + } + ], + "repo_age": 8.81, + "repo_path": "go/mattolenik__hclq", + "source": "commit:5b31af0dc21001c2ac770c1bea142b0e2ca0ef56", + "status": "done", + "url": "https://github.com/mattolenik/hclq" + }, + "instance_id": "mattolenik__hclq.5b31af0", + "language": "go", + "module_iterations": [], + "repository": "mattolenik/hclq" +} diff --git a/mattolenik--hclq.5b31af0/tests/test.sh b/mattolenik--hclq.5b31af0/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mattolenik--hclq.5b31af0/tests/workspace.tar.gz b/mattolenik--hclq.5b31af0/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a13301ce0061d8a3a241ad14f092ce93074b6010 --- /dev/null +++ b/mattolenik--hclq.5b31af0/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:333f7ebf2721e35bfcd9ecbca875245241173d5215aa2cd94732ba0b1638e98e +size 4337 diff --git a/mavam--libbf.4c9efc1/environment/Dockerfile b/mavam--libbf.4c9efc1/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..736b92148dd4c993902b7d08b80956d73d9819e7 --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/Dockerfile @@ -0,0 +1,57 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/mavam--libbf.4c9efc1/environment/download.sh b/mavam--libbf.4c9efc1/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..b16b0a6b34976427e3b0c60034450ebb5ae7b5cd --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/download.sh @@ -0,0 +1,53 @@ +# ProgramGym download stage for mavam/libbf (cpp). +# +# This script is SOURCED (`source /source_ro/download.sh`) in a read-only, +# networked download container BEFORE the repository is copied into the offline +# build workspace. It must be a completely standalone single file: it must not +# read any repository build/source file, and it must not compile, link, test, +# package, or otherwise build the project. Its only responsibility is to +# guarantee the dependency/toolchain state that build.sh relies on and to +# export the environment variables build.sh consumes. +# +# It is valid to run in shell "source" mode: it never terminates the parent +# shell in normal control flow and uses no positional arguments. No +# `set -euo pipefail` is used here so a non-fatal check in this sourced context +# cannot terminate the parent shell; every condition that matters is handled +# with an explicit branch. + +# --------------------------------------------------------------------------- +# Dependency assessment (verified against the base image: Ubuntu 22.04). +# +# Building the selected `bf` tool (test/bf/bf.cc) needs: +# - a C++11 compiler -> base image provides one (verified present) +# - a CMake build system -> base image provides one (verified present) +# - a Make driver -> base image provides one (verified present) +# - POSIX threads (pthread) -> provided by glibc, found by find_package(Threads) +# +# libbf has no third-party library dependency. No -dev package, no external +# source archive, and no package-manager step is required. This download stage +# therefore performs no downloads and fills no caches; the toolchain already +# present in the base image is sufficient. The only thing it must do is export +# the linker settings build.sh relies on (see below). +# --------------------------------------------------------------------------- + +# The offline runtime's system C++ standard library +# (/lib/x86_64-linux-gnu/libstdc++.so.6) only exports symbols up to +# GLIBCXX_3.4.30, whereas the base image's default toolchain emits references +# up to GLIBCXX_3.4.32. So that ./executable runs against the offline system +# libraries, build.sh statically links the C and C++ runtime support into the +# `bf` executable, and adds an '$ORIGIN' rpath so the executable locates its +# project-owned shared library (./libbf.so) placed next to it at the repository +# root. +# +# build.sh reads this value so the runtime-linkage decision is registered here +# (the offline-safe, dependency stage) and kept out of build.sh. +if [ -n "${LBF_CMAKE_EXE_LINKER_FLAGS:-}" ]; then + # Respect an externally supplied override; otherwise use the required value. + : +else + export LBF_CMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++ -Wl,-rpath,\$ORIGIN" +fi + +# Record readiness for build.sh. No dependency caches or manifests were +# prepared because none are needed; the base-image toolchain is complete. +export LBF_DOWNLOAD_READY=1 diff --git a/mavam--libbf.4c9efc1/environment/executable b/mavam--libbf.4c9efc1/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..af8b35dfa78836b03bd8b3a33738952df6b6857b --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73e634d124887b7563135efa89993fb01d492ae4fef21642f59f58cb91e05fa1 +size 3268728 diff --git a/mavam--libbf.4c9efc1/environment/harbor_prepare_download_env.sh b/mavam--libbf.4c9efc1/environment/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mavam--libbf.4c9efc1/environment/programgym-gcc13.tar.gz b/mavam--libbf.4c9efc1/environment/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/mavam--libbf.4c9efc1/environment/workspace.tar.gz b/mavam--libbf.4c9efc1/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f4d1e8c864100976fa14e5834d9832c3258a5b36 --- /dev/null +++ b/mavam--libbf.4c9efc1/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:468cdf4a1f61469d2d29130c5a7961e8ea5660fd15b451a222603b5eae8e2c14 +size 2887 diff --git a/mavam--libbf.4c9efc1/instruction.md b/mavam--libbf.4c9efc1/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/mavam--libbf.4c9efc1/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/mavam--libbf.4c9efc1/solution/solve.sh b/mavam--libbf.4c9efc1/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/mavam--libbf.4c9efc1/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/mavam--libbf.4c9efc1/task.toml b/mavam--libbf.4c9efc1/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..58e10a26ba426fc6223564682951aa291006a59b --- /dev/null +++ b/mavam--libbf.4c9efc1/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/mavam--libbf.4c9efc1" +description = "Synthetic ProgramGym cleanroom reconstruction task for mavam/libbf" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "cpp"] + +[metadata] +source = "ProgramGym" +instance_id = "mavam__libbf.4c9efc1" +repository = "mavam/libbf" +commit = "4c9efc1a4db7ed1ccf54cf0bd3a3641ce579206c" +language = "cpp" +difficulty = "easy" +difficulty_score = 1.6159500516564012 +test_branches = 4 +test_count = 699 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/mavam--libbf.4c9efc1/tests/Dockerfile b/mavam--libbf.4c9efc1/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7ff3c98df93505861b0a050209ad20f385db35f4 --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/Dockerfile @@ -0,0 +1,65 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* +ARG CMAKE_VERSION=3.31.10 +ARG CMAKE_PYPI_INDEX_URL=https://pypi.org/simple +RUN set -eux; python3 -m pip install --no-cache-dir --index-url "${CMAKE_PYPI_INDEX_URL}" --trusted-host "mirror.example.invalid" "cmake==${CMAKE_VERSION}"; cmake --version; ctest --version; cpack --version +COPY programgym-gcc13.tar.gz /tmp/gcc.tar.gz +ARG GCC_VERSION=13.3.0 +RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; if [ "${GCC_ARCH}" != "x64" ]; then echo "the staged GCC 13 archive is for x64, got ${GCC_ARCH}" >&2; exit 1; fi; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh +RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ + && /bin/bash /tmp/harbor_prepare_download_env.sh \ + && rm -f /workspace/download.sh \ + && rm -f /tmp/harbor_prepare_download_env.sh +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_01.tar.gz b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..78e978996d7bcd39fd0abcfca4ef97936c597224 --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04361eda9db6e98f1abcd50b1d9c3ca46084bbf5143c4e22b1d7c3ccde080f07 +size 14573 diff --git a/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_02.tar.gz b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d56d1ec25488fce81e335f02a2f56ff02b89eafb --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:558319a5b34d1104f2110fc7c5e1ce85397db70f06a493900a4a7038352c0a3d +size 23803 diff --git a/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_03.tar.gz b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..15171eed207045ab7c44b95eebf0fb7d0a40a70a --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bf444396dc00af06f65e077f1aaf2ba321b20fad9c1da195b285f952d75efe7 +size 24140 diff --git a/mavam--libbf.4c9efc1/tests/blobs/tests/generated_upstream.tar.gz b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..99ecafc5ec832cb9b3dd6321d4bc78fa52b4206e --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38715a729733327a1a9c7960d826676783424250443a11eb91a402b95d140e17 +size 6734 diff --git a/mavam--libbf.4c9efc1/tests/download.sh b/mavam--libbf.4c9efc1/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..b16b0a6b34976427e3b0c60034450ebb5ae7b5cd --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/download.sh @@ -0,0 +1,53 @@ +# ProgramGym download stage for mavam/libbf (cpp). +# +# This script is SOURCED (`source /source_ro/download.sh`) in a read-only, +# networked download container BEFORE the repository is copied into the offline +# build workspace. It must be a completely standalone single file: it must not +# read any repository build/source file, and it must not compile, link, test, +# package, or otherwise build the project. Its only responsibility is to +# guarantee the dependency/toolchain state that build.sh relies on and to +# export the environment variables build.sh consumes. +# +# It is valid to run in shell "source" mode: it never terminates the parent +# shell in normal control flow and uses no positional arguments. No +# `set -euo pipefail` is used here so a non-fatal check in this sourced context +# cannot terminate the parent shell; every condition that matters is handled +# with an explicit branch. + +# --------------------------------------------------------------------------- +# Dependency assessment (verified against the base image: Ubuntu 22.04). +# +# Building the selected `bf` tool (test/bf/bf.cc) needs: +# - a C++11 compiler -> base image provides one (verified present) +# - a CMake build system -> base image provides one (verified present) +# - a Make driver -> base image provides one (verified present) +# - POSIX threads (pthread) -> provided by glibc, found by find_package(Threads) +# +# libbf has no third-party library dependency. No -dev package, no external +# source archive, and no package-manager step is required. This download stage +# therefore performs no downloads and fills no caches; the toolchain already +# present in the base image is sufficient. The only thing it must do is export +# the linker settings build.sh relies on (see below). +# --------------------------------------------------------------------------- + +# The offline runtime's system C++ standard library +# (/lib/x86_64-linux-gnu/libstdc++.so.6) only exports symbols up to +# GLIBCXX_3.4.30, whereas the base image's default toolchain emits references +# up to GLIBCXX_3.4.32. So that ./executable runs against the offline system +# libraries, build.sh statically links the C and C++ runtime support into the +# `bf` executable, and adds an '$ORIGIN' rpath so the executable locates its +# project-owned shared library (./libbf.so) placed next to it at the repository +# root. +# +# build.sh reads this value so the runtime-linkage decision is registered here +# (the offline-safe, dependency stage) and kept out of build.sh. +if [ -n "${LBF_CMAKE_EXE_LINKER_FLAGS:-}" ]; then + # Respect an externally supplied override; otherwise use the required value. + : +else + export LBF_CMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++ -Wl,-rpath,\$ORIGIN" +fi + +# Record readiness for build.sh. No dependency caches or manifests were +# prepared because none are needed; the base-image toolchain is complete. +export LBF_DOWNLOAD_READY=1 diff --git a/mavam--libbf.4c9efc1/tests/executable b/mavam--libbf.4c9efc1/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..af8b35dfa78836b03bd8b3a33738952df6b6857b --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73e634d124887b7563135efa89993fb01d492ae4fef21642f59f58cb91e05fa1 +size 3268728 diff --git a/mavam--libbf.4c9efc1/tests/harbor_prepare_download_env.sh b/mavam--libbf.4c9efc1/tests/harbor_prepare_download_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..2c7dd2f2b8fff5fb8926261279d38518e59e407c --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/harbor_prepare_download_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /workspace +set -a +source /workspace/download.sh +set +a +python3 - <<'PY' > /etc/profile.d/programgym_download_env.sh +import os +import shlex + +ignored = { + "ALL_PROXY", + "HTTP_PROXY", + "HTTPS_PROXY", + "NO_PROXY", + "OLDPWD", + "PIP_PROXY", + "PWD", + "SHLVL", + "_", + "all_proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "pip_proxy", +} +for key in sorted(os.environ): + if key in ignored or key.startswith("BASH_FUNC_"): + continue + value = os.environ[key] + if "\n" in value: + continue + print(f"export {key}={shlex.quote(value)}") +PY diff --git a/mavam--libbf.4c9efc1/tests/programgym-gcc13.tar.gz b/mavam--libbf.4c9efc1/tests/programgym-gcc13.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d65584edfe74425f789a3d2095fa0f130d7ab461 --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/programgym-gcc13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f67d082b220036c564f110ec9a2dffb736597685d2424761993561d836ebf88 +size 146620404 diff --git a/mavam--libbf.4c9efc1/tests/programgym_evaluator.py b/mavam--libbf.4c9efc1/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/mavam--libbf.4c9efc1/tests/programgym_task.json b/mavam--libbf.4c9efc1/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..1c40d0536a98f47a9488ccbec1bc36911310b5ff --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/programgym_task.json @@ -0,0 +1,945 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_basic.test_basic_absent_element_is_tn", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[1024x8]", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[16x2]", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[1x1]", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[32x3]", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[64x4]", + "eval.tests.test_basic.test_basic_cells_k_combos_valid[8x1]", + "eval.tests.test_basic.test_basic_custom_seed_changes_hash_layout", + "eval.tests.test_basic.test_basic_double_hashing_flag", + "eval.tests.test_basic.test_basic_fp_and_partition_and_double", + "eval.tests.test_basic.test_basic_fp_rate_capacity_provisions[10pct10]", + "eval.tests.test_basic.test_basic_fp_rate_capacity_provisions[1pct100]", + "eval.tests.test_basic.test_basic_fp_rate_capacity_provisions[30pct1000]", + "eval.tests.test_basic.test_basic_fp_rate_capacity_provisions[50pct8]", + "eval.tests.test_basic.test_basic_fp_rate_capacity_provisions[5pct50]", + "eval.tests.test_basic.test_basic_fp_rate_zero_path_falls_back_to_cells[both-zero]", + "eval.tests.test_basic.test_basic_fp_rate_zero_path_falls_back_to_cells[capacity-zero]", + "eval.tests.test_basic.test_basic_fp_rate_zero_path_falls_back_to_cells[fp-zero]", + "eval.tests.test_basic.test_basic_header_emitted_before_rows", + "eval.tests.test_basic.test_basic_partition_flag_changes_storage", + "eval.tests.test_basic.test_basic_returns_one_for_present_zero_for_absent", + "eval.tests.test_basic.test_basic_tiny_filter_false_positive_for_absent", + "eval.tests.test_basic.test_basic_zero_cells_rejected", + "eval.tests.test_basic.test_basic_zero_k_rejected", + "eval.tests.test_cli.test_help_flag_overrides_missing_required_option[input]", + "eval.tests.test_cli.test_help_flag_overrides_missing_required_option[query]", + "eval.tests.test_cli.test_help_flag_overrides_missing_required_option[type]", + "eval.tests.test_cli.test_help_long_flag_prints_identical_full_usage", + "eval.tests.test_cli.test_help_short_flag_prints_full_usage_on_stderr", + "eval.tests.test_cli.test_invalid_bloom_filter_type", + "eval.tests.test_cli.test_missing_input_argument", + "eval.tests.test_cli.test_missing_query_argument", + "eval.tests.test_cli.test_missing_type_has_required_args", + "eval.tests.test_cli.test_no_arguments_prints_all_option_blocks", + "eval.tests.test_cli.test_non_option_argument_rejected", + "eval.tests.test_cli.test_option_value_required_for_single_value_option", + "eval.tests.test_cli.test_short_option_with_inline_value", + "eval.tests.test_cli.test_unknown_long_option_rejected", + "eval.tests.test_cli.test_unknown_short_option_rejected", + "eval.tests.test_counting.test_counting_counter_saturation[1-1]", + "eval.tests.test_counting.test_counting_counter_saturation[1-2]", + "eval.tests.test_counting.test_counting_counter_saturation[1-5]", + "eval.tests.test_counting.test_counting_counter_saturation[2-3]", + "eval.tests.test_counting.test_counting_counter_saturation[2-4]", + "eval.tests.test_counting.test_counting_counter_saturation[4-10]", + "eval.tests.test_counting.test_counting_large_multiplicity[100]", + "eval.tests.test_counting.test_counting_large_multiplicity[10]", + "eval.tests.test_counting.test_counting_large_multiplicity[1]", + "eval.tests.test_counting.test_counting_large_multiplicity[2]", + "eval.tests.test_counting.test_counting_large_multiplicity[4]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[16]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[1]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[2]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[32]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[3]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[4]", + "eval.tests.test_counting.test_counting_multiplicity_across_widths[8]", + "eval.tests.test_counting.test_counting_partition_accepts_duplicates", + "eval.tests.test_counting.test_counting_reports_true_multiplicity", + "eval.tests.test_counting.test_counting_zero_cells_rejected", + "eval.tests.test_counting.test_counting_zero_k_rejected", + "eval.tests.test_counting.test_counting_zero_width_rejected", + "eval.tests.test_counting.test_spectral_flavors_absent_is_zero[counting]", + "eval.tests.test_counting.test_spectral_flavors_absent_is_zero[spectral-mi]", + "eval.tests.test_counting.test_spectral_flavors_absent_is_zero[spectral-rm]", + "eval.tests.test_counting.test_spectral_flavors_count_duplicates[counting]", + "eval.tests.test_counting.test_spectral_flavors_count_duplicates[spectral-mi]", + "eval.tests.test_counting.test_spectral_flavors_count_duplicates[spectral-rm]", + "eval.tests.test_counting.test_spectral_rm_requires_second_cells", + "eval.tests.test_counting.test_spectral_rm_requires_second_k", + "eval.tests.test_counting.test_spectral_rm_second_cells_zero_explicit", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[1]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[2]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[3]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[4]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[5]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[6]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[7]", + "eval.tests.test_counting.test_stable_nonzero_seed_reports_max_counter[8]", + "eval.tests.test_counting.test_stable_seed_zero_crashes_on_real_input", + "eval.tests.test_counting.test_stable_zero_evict", + "eval.tests.test_inputs.test_blank_lines_in_input_skipped", + "eval.tests.test_inputs.test_classification_tp_and_tn", + "eval.tests.test_inputs.test_cumulative_counters_accumulate", + "eval.tests.test_inputs.test_empty_input_and_empty_query", + "eval.tests.test_inputs.test_missing_input_file", + "eval.tests.test_inputs.test_missing_query_file", + "eval.tests.test_inputs.test_numeric_mode_absent_element_returns_zero", + "eval.tests.test_inputs.test_numeric_mode_floats", + "eval.tests.test_inputs.test_numeric_mode_query_element_is_number", + "eval.tests.test_inputs.test_numeric_whitespace_element_note", + "eval.tests.test_inputs.test_object_size_over_limit_aborts[128]", + "eval.tests.test_inputs.test_object_size_over_limit_aborts[37-oversize]", + "eval.tests.test_inputs.test_object_size_over_limit_aborts[64]", + "eval.tests.test_inputs.test_object_size_within_limit_inserted[1-byte]", + "eval.tests.test_inputs.test_object_size_within_limit_inserted[12-byte]", + "eval.tests.test_inputs.test_object_size_within_limit_inserted[36-max-ok]", + "eval.tests.test_inputs.test_object_too_large_string_aborts", + "eval.tests.test_inputs.test_whitespace_in_input_rejected[leading-space]", + "eval.tests.test_inputs.test_whitespace_in_input_rejected[multi-space]", + "eval.tests.test_inputs.test_whitespace_in_input_rejected[space]", + "eval.tests.test_inputs.test_whitespace_in_input_rejected[tab]", + "eval.tests.test_inputs.test_whitespace_in_input_rejected[trailing-space]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[a2]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[basic]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[bitwise]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[counting]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[spectral-mi]", + "eval.tests.test_inputs.test_whitespace_rejected_for_every_type[stable]", + "eval.tests.test_spectral_rm_single_min.test_rm_k2_collision_unique_min_single_add", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_mixed_present_absent_pairs", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_secondary_absent_falls_back_to_primary[delta]", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_secondary_absent_falls_back_to_primary[ghost]", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_secondary_absent_falls_back_to_primary[never]", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_secondary_absent_falls_back_to_primary[omega]", + "eval.tests.test_spectral_rm_single_min.test_rm_lookup_secondary_present_returns_secondary", + "eval.tests.test_spectral_rm_single_min.test_rm_many_distinct_elements_each_single_min[1elem]", + "eval.tests.test_spectral_rm_single_min.test_rm_many_distinct_elements_each_single_min[3elem]", + "eval.tests.test_spectral_rm_single_min.test_rm_many_distinct_elements_each_single_min[8elem]", + "eval.tests.test_spectral_rm_single_min.test_rm_mismatched_primary_secondary_widths[w16W3]", + "eval.tests.test_spectral_rm_single_min.test_rm_mismatched_primary_secondary_widths[w2W8-no-saturate]", + "eval.tests.test_spectral_rm_single_min.test_rm_mismatched_primary_secondary_widths[w3W3]", + "eval.tests.test_spectral_rm_single_min.test_rm_mismatched_primary_secondary_widths[w8W2-saturate]", + "eval.tests.test_spectral_rm_single_min.test_rm_mismatched_primary_secondary_widths[w8W3]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_multi_hash_distinct[k1]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_multi_hash_distinct[k2]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_multi_hash_distinct[k4]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_single_min_counts[100x8x2]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_single_min_counts[1024x4x4]", + "eval.tests.test_spectral_rm_single_min.test_rm_partition_single_min_counts[300x8x3]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_double_hashing[double]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_double_hashing[plain]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_seed_variants[S0]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_seed_variants[S42]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_seed_variants[S7]", + "eval.tests.test_spectral_rm_single_min.test_rm_second_seed_variants[S999]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_counter_saturation[w1x3]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_counter_saturation[w2x3]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_counter_saturation[w2x5]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_counter_saturation[w4x12]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_counter_saturation[w8x20]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_cumulative_classification", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_primary_secondary_hash_counts[K1]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_primary_secondary_hash_counts[K2]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_primary_secondary_hash_counts[K3]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_primary_secondary_hash_counts[K4]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_primary_secondary_hash_counts[K8]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[10]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[1]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[2]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[3]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[4]", + "eval.tests.test_spectral_rm_single_min.test_rm_single_min_reports_true_multiplicity[5]", + "eval.tests.test_variants.test_a2_basic_membership", + "eval.tests.test_variants.test_a2_capacity_exceeded_evicts_oldest", + "eval.tests.test_variants.test_a2_distinct_within_capacity_all_present", + "eval.tests.test_variants.test_a2_odd_cells_accepted", + "eval.tests.test_variants.test_a2_zero_capacity_rejected", + "eval.tests.test_variants.test_a2_zero_cells_rejected", + "eval.tests.test_variants.test_a2_zero_k_rejected", + "eval.tests.test_variants.test_bitwise_absent_element_zero", + "eval.tests.test_variants.test_bitwise_distinct_each_present_once", + "eval.tests.test_variants.test_bitwise_reports_multiplicity", + "eval.tests.test_variants.test_bitwise_various_multiplicities[1]", + "eval.tests.test_variants.test_bitwise_various_multiplicities[2]", + "eval.tests.test_variants.test_bitwise_various_multiplicities[4]", + "eval.tests.test_variants.test_bitwise_various_multiplicities[5]", + "eval.tests.test_variants.test_bitwise_zero_cells_rejected", + "eval.tests.test_variants.test_bitwise_zero_k_rejected" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_error_handling.test_help_lists_all_filter_types", + "reasons": [ + { + "detail": "empty executable run failed as expected with returncode=1", + "id": "dummy_pass", + "message": "test passed against the empty executable", + "repair_hint": "Assert concrete black-box executable behavior so an empty executable cannot satisfy the test.", + "severity": "error", + "stage": "dummy_execution" + }, + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + }, + { + "id": "golden_no_equality", + "message": "pytest test references golden data without equality comparison", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Compare observed output to golden data with equality after any explicit normalization.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_help_long_flag_exits_zero_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_help_prefers_existing_files_not_required", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_help_short_flag_exits_zero_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_invalid_filter_type", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_no_arguments_prints_usage_matches_golden", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_option_missing_value_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + }, + { + "name": "eval.tests.test_error_handling.test_unknown_option_rejected", + "reasons": [ + { + "id": "generic_keyword_oracle", + "message": "pytest test uses a generic keyword oracle", + "path": "eval/tests/test_error_handling.py", + "repair_hint": "Replace generic keyword checks with exact diagnostics, structured output, or golden comparisons.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_bitvector_membership.test_a2_filter_present_element", + "eval.tests.test_bitvector_membership.test_a2_second_stage_not_triggered_present", + "eval.tests.test_bitvector_membership.test_basic_absent_member_zero[missing]", + "eval.tests.test_bitvector_membership.test_basic_absent_member_zero[nope]", + "eval.tests.test_bitvector_membership.test_basic_absent_member_zero[quux]", + "eval.tests.test_bitvector_membership.test_basic_absent_member_zero[zzz]", + "eval.tests.test_bitvector_membership.test_basic_case_sensitive_bits", + "eval.tests.test_bitvector_membership.test_basic_header_and_row_count", + "eval.tests.test_bitvector_membership.test_basic_membership_present[alpha]", + "eval.tests.test_bitvector_membership.test_basic_membership_present[beta]", + "eval.tests.test_bitvector_membership.test_basic_membership_present[delta]", + "eval.tests.test_bitvector_membership.test_basic_membership_present[gamma]", + "eval.tests.test_bitvector_membership.test_basic_multiple_in_file_all_present", + "eval.tests.test_bitvector_membership.test_basic_present_and_absent_mixed", + "eval.tests.test_bitvector_membership.test_bitwise_absent_low_false_positive_large_space", + "eval.tests.test_bitvector_membership.test_bitwise_filter_reports_membership", + "eval.tests.test_bitvector_membership.test_same_element_repeated_in_file", + "eval.tests.test_bitvector_membership.test_spectral_mi_absent_is_zero", + "eval.tests.test_bitvector_membership.test_spectral_mi_reports_count", + "eval.tests.test_bitvector_membership.test_spectral_rm_absent_zero", + "eval.tests.test_bitvector_membership.test_spectral_rm_present", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_numeric_promotion_count", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promoted_absent_queries_zero", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_cell_size_stable[32768]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_cell_size_stable[65536]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_cell_size_stable[8192]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[100]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[12]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[17]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[25]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[40]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[64]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[7]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[80]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[8]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_count_equals_inserts[9]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_double_hashing_deterministic", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_exact_tp[10]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_exact_tp[16]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_exact_tp[31]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_exact_tp[63]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_exact_tp[7]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_gt_below_count_is_fp[1]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_gt_below_count_is_fp[20]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_gt_below_count_is_fp[50]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_seed_deterministic[0]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_seed_deterministic[3]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_seed_deterministic[42]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_deep_promotion_table_header_shape", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_three_deep_elements_distinct_counts", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_two_deep_elements_isolated[100-100]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_two_deep_elements_isolated[13-21]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_two_deep_elements_isolated[40-3]", + "eval.tests.test_bitwise_deep_level_promotion.test_bitwise_two_deep_elements_isolated[7-64]", + "eval.tests.test_bitwise_removal_path.test_bitwise_ground_truth_above_count_is_fn", + "eval.tests.test_bitwise_removal_path.test_bitwise_ground_truth_below_count_is_fp", + "eval.tests.test_bitwise_removal_path.test_bitwise_many_distinct_each_count_one", + "eval.tests.test_bitwise_removal_path.test_bitwise_mixed_promoted_and_single", + "eval.tests.test_bitwise_removal_path.test_bitwise_output_table_shape", + "eval.tests.test_bitwise_removal_path.test_bitwise_promote_ground_truth_exact_tp[1]", + "eval.tests.test_bitwise_removal_path.test_bitwise_promote_ground_truth_exact_tp[2]", + "eval.tests.test_bitwise_removal_path.test_bitwise_promote_ground_truth_exact_tp[3]", + "eval.tests.test_bitwise_removal_path.test_bitwise_promote_ground_truth_exact_tp[4]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[1-1]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[2-2]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[3-3]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[4-4]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[5-5]", + "eval.tests.test_bitwise_removal_path.test_bitwise_repeat_inserts_promote_and_reset[6-6]", + "eval.tests.test_bitwise_removal_path.test_bitwise_single_element_plus_re_add_survives", + "eval.tests.test_bitwise_removal_path.test_bitwise_two_elements_distinct_counts", + "eval.tests.test_counter_wide_classification.test_counter_classification_relative_to_count[0-FP]", + "eval.tests.test_counter_wide_classification.test_counter_classification_relative_to_count[1-FP]", + "eval.tests.test_counter_wide_classification.test_counter_classification_relative_to_count[5-TP]", + "eval.tests.test_counter_wide_classification.test_counter_classification_relative_to_count[9-FN]", + "eval.tests.test_counter_wide_classification.test_counter_distinct_wide_isolation_at_scale", + "eval.tests.test_counter_wide_classification.test_counter_multi_classification_stream_exact", + "eval.tests.test_counter_wide_classification.test_counter_saturate_clamps_at_width_ceiling[1-1]", + "eval.tests.test_counter_wide_classification.test_counter_saturate_clamps_at_width_ceiling[2-3]", + "eval.tests.test_counter_wide_classification.test_counter_saturate_clamps_at_width_ceiling[4-15]", + "eval.tests.test_counter_wide_classification.test_counter_saturate_clamps_at_width_ceiling[8-255]", + "eval.tests.test_counter_wide_classification.test_counter_spectral_mi_width8_count_at_scale", + "eval.tests.test_counter_wide_classification.test_counter_width16_exact_above_255", + "eval.tests.test_counter_wide_classification.test_counter_width6_saturate_at_63_tp", + "eval.tests.test_counter_wide_classification.test_counter_width8_exact_high_counts[100]", + "eval.tests.test_counter_wide_classification.test_counter_width8_exact_high_counts[200]", + "eval.tests.test_counter_wide_classification.test_counter_width8_exact_high_counts[255]", + "eval.tests.test_counter_wide_classification.test_counter_width8_exact_high_counts[50]", + "eval.tests.test_counter_wide_classification.test_counter_width8_saturates_at_255", + "eval.tests.test_counting_counters.test_counter_absent_element_is_zero[1]", + "eval.tests.test_counting_counters.test_counter_absent_element_is_zero[4]", + "eval.tests.test_counting_counters.test_counter_absent_element_is_zero[8]", + "eval.tests.test_counting_counters.test_counter_count_matches_exact_insert_count[15]", + "eval.tests.test_counting_counters.test_counter_count_matches_exact_insert_count[1]", + "eval.tests.test_counting_counters.test_counter_count_matches_exact_insert_count[4]", + "eval.tests.test_counting_counters.test_counter_count_matches_exact_insert_count[7]", + "eval.tests.test_counting_counters.test_counter_distinct_elements_yield_one_each", + "eval.tests.test_counting_counters.test_counter_high_word_count_does_not_collide", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[1-2]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[1-3]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[1-4]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[1-5]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[2-2]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[2-3]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[2-4]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[2-5]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[3-2]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[3-3]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[3-4]", + "eval.tests.test_counting_counters.test_counter_increments_with_repeat_inserts[3-5]", + "eval.tests.test_counting_counters.test_counter_reaches_exact_max_not_beyond[1-1]", + "eval.tests.test_counting_counters.test_counter_reaches_exact_max_not_beyond[2-3]", + "eval.tests.test_counting_counters.test_counter_reaches_exact_max_not_beyond[4-15]", + "eval.tests.test_counting_counters.test_counter_reaches_exact_max_not_beyond[6-63]", + "eval.tests.test_counting_counters.test_counter_saturates_at_width_max[1-1]", + "eval.tests.test_counting_counters.test_counter_saturates_at_width_max[2-3]", + "eval.tests.test_counting_counters.test_counter_saturates_at_width_max[3-7]", + "eval.tests.test_counting_counters.test_counter_saturates_at_width_max[4-15]", + "eval.tests.test_counting_counters.test_counter_single_insert_reports_one", + "eval.tests.test_counting_counters.test_counter_zero_width_absent_after_clear_like_behavior", + "eval.tests.test_counting_counters.test_counting_one_row_per_query", + "eval.tests.test_counting_counters.test_counting_output_header_shape", + "eval.tests.test_counting_counters.test_counting_tp_when_count_equals_ground_truth", + "eval.tests.test_error_handling.test_a2_odd_cells_truncates_evenly", + "eval.tests.test_error_handling.test_a2_zero_capacity_rejected", + "eval.tests.test_error_handling.test_counting_zero_width_rejected", + "eval.tests.test_error_handling.test_help_lists_all_filter_types", + "eval.tests.test_error_handling.test_help_long_flag_exits_zero_matches_golden", + "eval.tests.test_error_handling.test_help_prefers_existing_files_not_required", + "eval.tests.test_error_handling.test_help_short_flag_exits_zero_matches_golden", + "eval.tests.test_error_handling.test_invalid_filter_type", + "eval.tests.test_error_handling.test_missing_input_file_unreadable", + "eval.tests.test_error_handling.test_missing_input_flag", + "eval.tests.test_error_handling.test_missing_query_file_unreadable", + "eval.tests.test_error_handling.test_missing_query_flag", + "eval.tests.test_error_handling.test_missing_type_flag", + "eval.tests.test_error_handling.test_no_arguments_prints_usage_matches_golden", + "eval.tests.test_error_handling.test_numeric_mode_base_validation", + "eval.tests.test_error_handling.test_option_missing_value_rejected", + "eval.tests.test_error_handling.test_spectral_mi_zero_width_rejected", + "eval.tests.test_error_handling.test_spectral_rm_zero_second_cells_rejected", + "eval.tests.test_error_handling.test_spectral_rm_zero_second_width_rejected", + "eval.tests.test_error_handling.test_tab_in_input_rejected", + "eval.tests.test_error_handling.test_unknown_option_rejected", + "eval.tests.test_error_handling.test_unreadable_input_directory_path", + "eval.tests.test_error_handling.test_whitespace_in_input_rejected", + "eval.tests.test_error_handling.test_zero_cells_rejected", + "eval.tests.test_error_handling.test_zero_k_rejected", + "eval.tests.test_filter_matrix_distinct.test_a2_lookup_probes_primary_then_secondary", + "eval.tests.test_filter_matrix_distinct.test_a2_swap_boundary_membership[3-3-expected0]", + "eval.tests.test_filter_matrix_distinct.test_a2_swap_boundary_membership[4-1-expected1]", + "eval.tests.test_filter_matrix_distinct.test_a2_swap_boundary_membership[5-2-expected2]", + "eval.tests.test_filter_matrix_distinct.test_a2_swap_boundary_membership[6-2-expected3]", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_double_hash_determinism[0]", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_double_hash_determinism[42]", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_double_hash_determinism[7]", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_partition_does_not_false_positive", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_single_member_is_tp_not_fp", + "eval.tests.test_filter_matrix_distinct.test_fpr_resize_with_partition_preserves_membership", + "eval.tests.test_filter_matrix_distinct.test_spectral_mi_counter_saturates_at_ceiling[2-3]", + "eval.tests.test_filter_matrix_distinct.test_spectral_mi_counter_saturates_at_ceiling[4-15]", + "eval.tests.test_filter_matrix_distinct.test_spectral_mi_counter_saturates_at_ceiling[6-63]", + "eval.tests.test_filter_matrix_distinct.test_spectral_mi_counter_saturates_at_ceiling[8-255]", + "eval.tests.test_filter_matrix_distinct.test_spectral_rm_absent_across_both_stages_zero", + "eval.tests.test_filter_matrix_distinct.test_spectral_rm_mixed_counts_isolation", + "eval.tests.test_filter_matrix_distinct.test_spectral_rm_returns_aggregate_count[2-2-2]", + "eval.tests.test_filter_matrix_distinct.test_spectral_rm_returns_aggregate_count[3-3-3]", + "eval.tests.test_filter_matrix_distinct.test_spectral_rm_returns_aggregate_count[5-5-5]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_absent_query_is_tn", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_newest_survives_overflow", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_overflow_eviction_pattern[1-items0-expected0]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_overflow_eviction_pattern[1-items2-expected2]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_overflow_eviction_pattern[10-items4-expected4]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_overflow_eviction_pattern[2-items1-expected1]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_numeric_overflow_eviction_pattern[2-items3-expected3]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_overflow_deterministic_under_seeds[0-0]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_overflow_deterministic_under_seeds[1-2]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_a2_overflow_deterministic_under_seeds[7-99]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_aggregate_count[10]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_aggregate_count[25]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_aggregate_count[40]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_aggregate_count[60]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_two_elements_isolated", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_deep_with_partition", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_mixed_second_stage_preserves_count[6-second_cfg0]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_mixed_second_stage_preserves_count[6-second_cfg2]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_mixed_second_stage_preserves_count[8-second_cfg1]", + "eval.tests.test_overflow_eviction_and_staged_counters.test_spectral_rm_numeric_deep_count", + "eval.tests.test_partition_numeric_seed.test_cell_count_variation_preserves_counts[16]", + "eval.tests.test_partition_numeric_seed.test_cell_count_variation_preserves_counts[4096]", + "eval.tests.test_partition_numeric_seed.test_cell_count_variation_preserves_counts[512]", + "eval.tests.test_partition_numeric_seed.test_cell_count_variation_preserves_counts[64]", + "eval.tests.test_partition_numeric_seed.test_double_hashing_still_reports_present", + "eval.tests.test_partition_numeric_seed.test_fixed_seed_is_deterministic[0]", + "eval.tests.test_partition_numeric_seed.test_fixed_seed_is_deterministic[12345]", + "eval.tests.test_partition_numeric_seed.test_fixed_seed_is_deterministic[1]", + "eval.tests.test_partition_numeric_seed.test_fixed_seed_is_deterministic[7]", + "eval.tests.test_partition_numeric_seed.test_fixed_seed_is_deterministic[99]", + "eval.tests.test_partition_numeric_seed.test_hash_function_count_variation[1]", + "eval.tests.test_partition_numeric_seed.test_hash_function_count_variation[2]", + "eval.tests.test_partition_numeric_seed.test_hash_function_count_variation[5]", + "eval.tests.test_partition_numeric_seed.test_hash_function_count_variation[8]", + "eval.tests.test_partition_numeric_seed.test_numeric_absent_zero", + "eval.tests.test_partition_numeric_seed.test_numeric_distinct_values_isolated", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[-7]", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[0]", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[100000]", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[1]", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[3.5]", + "eval.tests.test_partition_numeric_seed.test_numeric_input_reaches_counters[42]", + "eval.tests.test_partition_numeric_seed.test_numeric_output_render_element", + "eval.tests.test_partition_numeric_seed.test_numeric_repeated_increments", + "eval.tests.test_partition_numeric_seed.test_partitioned_absent_zero", + "eval.tests.test_partition_numeric_seed.test_partitioned_basic_membership", + "eval.tests.test_partition_numeric_seed.test_partitioned_counting_preserves_counts[2]", + "eval.tests.test_partition_numeric_seed.test_partitioned_counting_preserves_counts[4]", + "eval.tests.test_partition_numeric_seed.test_partitioned_counting_preserves_counts[8]", + "eval.tests.test_partition_numeric_seed.test_partitioned_spectral_mi_count", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_absent_element_is_tn", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_classification_relative_to_count[0-FP]", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_classification_relative_to_count[1-FP]", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_classification_relative_to_count[5-TP]", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_classification_relative_to_count[9-FN]", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_multi_row_classification_stream_exact", + "eval.tests.test_spectral_classification_streams.test_spectral_mi_saturation_then_classify", + "eval.tests.test_spectral_classification_streams.test_spectral_rm_classification_relative_to_count[0-FP]", + "eval.tests.test_spectral_classification_streams.test_spectral_rm_classification_relative_to_count[1-FP]", + "eval.tests.test_spectral_classification_streams.test_spectral_rm_classification_relative_to_count[5-TP]", + "eval.tests.test_spectral_classification_streams.test_spectral_rm_classification_relative_to_count[9-FN]", + "eval.tests.test_spectral_classification_streams.test_spectral_rm_numeric_mode_classification", + "eval.tests.test_storage_resize_and_swap.test_a2_capacity_controls_overflow_membership[1-expected_counts0-5]", + "eval.tests.test_storage_resize_and_swap.test_a2_capacity_controls_overflow_membership[10-expected_counts3-3]", + "eval.tests.test_storage_resize_and_swap.test_a2_capacity_controls_overflow_membership[2-expected_counts1-5]", + "eval.tests.test_storage_resize_and_swap.test_a2_capacity_controls_overflow_membership[3-expected_counts2-5]", + "eval.tests.test_storage_resize_and_swap.test_a2_clear_and_reuse_semantics", + "eval.tests.test_storage_resize_and_swap.test_a2_distinct_many_present_under_large_capacity", + "eval.tests.test_storage_resize_and_swap.test_a2_lookup_checks_both_stages", + "eval.tests.test_storage_resize_and_swap.test_a2_newest_survives_overflow[10]", + "eval.tests.test_storage_resize_and_swap.test_a2_newest_survives_overflow[1]", + "eval.tests.test_storage_resize_and_swap.test_a2_newest_survives_overflow[2]", + "eval.tests.test_storage_resize_and_swap.test_a2_newest_survives_overflow[5]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_present_is_tp[1]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_present_is_tp[500]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_present_is_tp[50]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_present_is_tp[5]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_resize_membership[0.001-1000-items1-queries1-expected1]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_resize_membership[0.01-100-items0-queries0-expected0]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_resize_membership[0.1-50-items2-queries2-expected2]", + "eval.tests.test_storage_resize_and_swap.test_fpr_capacity_resize_membership[0.5-10-items3-queries3-expected3]", + "eval.tests.test_storage_resize_and_swap.test_fpr_path_counting_ignores_fpr", + "eval.tests.test_storage_resize_and_swap.test_fpr_path_requires_both_flags", + "eval.tests.test_storage_resize_and_swap.test_fpr_path_with_partition", + "eval.tests.test_storage_resize_and_swap.test_fpr_resize_large_capacity_distinct_present", + "eval.tests.test_storage_resize_and_swap.test_fpr_variation_preserves_membership[0.001]", + "eval.tests.test_storage_resize_and_swap.test_fpr_variation_preserves_membership[0.01]", + "eval.tests.test_storage_resize_and_swap.test_fpr_variation_preserves_membership[0.05]", + "eval.tests.test_storage_resize_and_swap.test_fpr_variation_preserves_membership[0.2]" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_hash_cli_validation.test_degenerate_hasher_params_rejected[basic_zero_cells]", + "eval.tests.test_hash_cli_validation.test_degenerate_hasher_params_rejected[basic_zero_k]", + "eval.tests.test_hash_cli_validation.test_help_lists_hashing_options", + "eval.tests.test_hash_cli_validation.test_invalid_filter_type_rejected[bogus]", + "eval.tests.test_hash_cli_validation.test_invalid_filter_type_rejected[empty]", + "eval.tests.test_hash_cli_validation.test_invalid_filter_type_rejected[upper]", + "eval.tests.test_hash_cli_validation.test_missing_input_sets_are_rejected[--type]", + "eval.tests.test_hash_cli_validation.test_missing_input_sets_are_rejected[-t]", + "eval.tests.test_hash_cli_validation.test_missing_type_rejected", + "eval.tests.test_hash_cli_validation.test_no_args_prints_usage_and_succeeds", + "eval.tests.test_hash_cli_validation.test_nonexistent_input_file_rejected", + "eval.tests.test_hash_cli_validation.test_stdout_header_always_present", + "eval.tests.test_hash_cli_validation.test_whitespace_in_input_rejected", + "eval.tests.test_hash_collision_density.test_each_length_is_independently_findable", + "eval.tests.test_hash_collision_density.test_elements_length_1_to_36_all_self_found", + "eval.tests.test_hash_collision_density.test_empty_input_rows_are_skipped_not_hashed", + "eval.tests.test_hash_collision_density.test_fp_curve_deterministic_across_runs", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m1024]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m128]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m16]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m256]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m32]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m512]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m64]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m65536]", + "eval.tests.test_hash_collision_density.test_fp_curve_is_monotonic_as_cells_grow[m8]", + "eval.tests.test_hash_collision_density.test_large_filter_resolves_all_absent_to_tn", + "eval.tests.test_hash_collision_density.test_single_element_minimal_membership", + "eval.tests.test_hash_collision_density.test_small_filter_collides_all_absent", + "eval.tests.test_hash_collision_density.test_variable_length_output_deterministic", + "eval.tests.test_hash_composition.test_absent_element_count_is_subset_of_query[basic]", + "eval.tests.test_hash_composition.test_absent_element_count_is_subset_of_query[counting]", + "eval.tests.test_hash_composition.test_absent_element_reported_deterministically[basic]", + "eval.tests.test_hash_composition.test_absent_element_reported_deterministically[counting]", + "eval.tests.test_hash_composition.test_double_vs_single_composition_differs[basic]", + "eval.tests.test_hash_composition.test_double_vs_single_composition_differs[counting]", + "eval.tests.test_hash_composition.test_double_vs_single_composition_differs[spectral-mi]", + "eval.tests.test_hash_composition.test_inserted_element_reported_positive[basic]", + "eval.tests.test_hash_composition.test_inserted_element_reported_positive[counting]", + "eval.tests.test_hash_composition.test_inserted_element_reported_positive[spectral-mi]", + "eval.tests.test_hash_composition.test_k_streams_are_mutually_distinct", + "eval.tests.test_hash_composition.test_k_variation_changes_digest_stream[k1]", + "eval.tests.test_hash_composition.test_k_variation_changes_digest_stream[k2]", + "eval.tests.test_hash_composition.test_k_variation_changes_digest_stream[k3]", + "eval.tests.test_hash_composition.test_membership_counts_are_cumulative", + "eval.tests.test_hash_composition.test_same_seed_reproduces_identical_stream", + "eval.tests.test_hash_cross_filter_composition.test_a2_first_seed_changes_layout[s0]", + "eval.tests.test_hash_cross_filter_composition.test_a2_first_seed_changes_layout[s1]", + "eval.tests.test_hash_cross_filter_composition.test_a2_first_seed_changes_layout[s5]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k1]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k2]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k3]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k4]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k5]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_hasher_fp_by_k[k8]", + "eval.tests.test_hash_cross_filter_composition.test_bitwise_layout_deterministic", + "eval.tests.test_hash_cross_filter_composition.test_counting_width_changes_cell_packing[w1]", + "eval.tests.test_hash_cross_filter_composition.test_counting_width_changes_cell_packing[w2]", + "eval.tests.test_hash_cross_filter_composition.test_counting_width_changes_cell_packing[w8]", + "eval.tests.test_hash_cross_filter_composition.test_double_hashing_k1_degenerates_to_single", + "eval.tests.test_hash_cross_filter_composition.test_double_hashing_k_gt_1_changes_layout[k2]", + "eval.tests.test_hash_cross_filter_composition.test_double_hashing_k_gt_1_changes_layout[k3]", + "eval.tests.test_hash_cross_filter_composition.test_double_hashing_k_gt_1_changes_layout[k5]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_mi_hasher_fp_by_k[k2]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_mi_hasher_fp_by_k[k4]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_mi_hasher_fp_by_k[k6]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_double2_changes_layout[dbl2_False]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_double2_changes_layout[dbl2_True]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_layout_is_deterministic", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_second_seed_changes_layout[s2_0]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_second_seed_changes_layout[s2_1]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_second_seed_changes_layout[s2_2]", + "eval.tests.test_hash_cross_filter_composition.test_spectral_rm_second_seed_changes_layout[s2_7]", + "eval.tests.test_hash_cross_filter_composition.test_stable_evict_serial_changes_membership[e0]", + "eval.tests.test_hash_cross_filter_composition.test_stable_evict_serial_changes_membership[e1]", + "eval.tests.test_hash_cross_filter_composition.test_stable_evict_serial_changes_membership[e3]", + "eval.tests.test_hash_cross_filter_composition.test_stable_evict_serial_changes_membership[e8]", + "eval.tests.test_hash_cross_filter_composition.test_stable_seed_changes_layout[s1]", + "eval.tests.test_hash_cross_filter_composition.test_stable_seed_changes_layout[s4]", + "eval.tests.test_hash_fp_rate_capacity.test_double_hashing_is_observably_distinct", + "eval.tests.test_hash_fp_rate_capacity.test_empty_query_renders_header_only", + "eval.tests.test_hash_fp_rate_capacity.test_fp_rate_capacity_path_is_deterministic", + "eval.tests.test_hash_fp_rate_capacity.test_fp_rate_capacity_self_finds_inserted", + "eval.tests.test_hash_fp_rate_capacity.test_fp_rate_capacity_stream_is_reproducible[f0_001_c100]", + "eval.tests.test_hash_fp_rate_capacity.test_fp_rate_capacity_stream_is_reproducible[f0_01_c1000]", + "eval.tests.test_hash_fp_rate_capacity.test_fp_rate_capacity_stream_is_reproducible[f0_05_c500]", + "eval.tests.test_hash_fp_rate_capacity.test_input_line_with_whitespace_is_rejected", + "eval.tests.test_hash_fp_rate_capacity.test_numeric_mode_echoes_parsed_double_as_element[decimal]", + "eval.tests.test_hash_fp_rate_capacity.test_numeric_mode_echoes_parsed_double_as_element[huge_exp]", + "eval.tests.test_hash_fp_rate_capacity.test_numeric_mode_echoes_parsed_double_as_element[negative]", + "eval.tests.test_hash_fp_rate_capacity.test_partial_fp_rate_capacity_falls_back_to_cells_and_rejects[capacity_only]", + "eval.tests.test_hash_fp_rate_capacity.test_partial_fp_rate_capacity_falls_back_to_cells_and_rejects[fpr_only]", + "eval.tests.test_hash_fp_rate_capacity.test_query_element_with_whitespace_is_tokenized", + "eval.tests.test_hash_fp_rate_capacity.test_seed_changes_digest_layout", + "eval.tests.test_hash_fp_rate_capacity.test_seed_layout_is_stable_per_seed[seed0]", + "eval.tests.test_hash_fp_rate_capacity.test_seed_layout_is_stable_per_seed[seed1]", + "eval.tests.test_hash_fp_rate_capacity.test_seed_layout_is_stable_per_seed[seed2]", + "eval.tests.test_hash_fp_rate_capacity.test_seed_layout_is_stable_per_seed[seed3]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_a2_k2_s5_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_a2_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k1_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k2_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k2_small]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k3_s0_part_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k4_s1_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k4_s2_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_k5_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_basic_numeric]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_bit_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_bit_k4_s3_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_k2_s5_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_k2_small]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_k4_s0_part_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_numeric]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_count_numeric_dbl_s1]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_smi_k2_s1_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_smi_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_smi_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_srm_k3_k2_dbl_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_srm_k3_k3_med]", + "eval.tests.test_hash_golden.test_golden_deterministic_repeat[repeat_stable_k2_ev3_med]", + "eval.tests.test_hash_golden.test_golden_output[a2_k2_s5_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[a2_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k1_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k2_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k2_small]", + "eval.tests.test_hash_golden.test_golden_output[basic_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k3_s0_part_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k4_s1_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k4_s2_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_k5_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[basic_numeric]", + "eval.tests.test_hash_golden.test_golden_output[bit_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[bit_k4_s3_med]", + "eval.tests.test_hash_golden.test_golden_output[count_k2_s5_med]", + "eval.tests.test_hash_golden.test_golden_output[count_k2_small]", + "eval.tests.test_hash_golden.test_golden_output[count_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[count_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[count_k4_s0_part_med]", + "eval.tests.test_hash_golden.test_golden_output[count_numeric]", + "eval.tests.test_hash_golden.test_golden_output[count_numeric_dbl_s1]", + "eval.tests.test_hash_golden.test_golden_output[smi_k2_s1_med]", + "eval.tests.test_hash_golden.test_golden_output[smi_k3_s0_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[smi_k3_s0_med]", + "eval.tests.test_hash_golden.test_golden_output[srm_k3_k2_dbl_med]", + "eval.tests.test_hash_golden.test_golden_output[srm_k3_k3_med]", + "eval.tests.test_hash_golden.test_golden_output[stable_k2_ev3_med]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_absent_suffix_on_same_byte_is_true_negative", + "eval.tests.test_hash_h3_full_byte_and_seed.test_all_nonwhitespace_byte_values_self_found", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s0]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s123456789123456789]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s1]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s2147483648]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s4294967296]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_accepted_and_self_finds[s9223372036854775807]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_deterministic[s2p31]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_extreme_seed_deterministic[s2p63m1]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_full_byte_membership_deterministic", + "eval.tests.test_hash_h3_full_byte_and_seed.test_full_byte_range_self_found_other_flavors[basic]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_full_byte_range_self_found_other_flavors[counting]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_kvariant_double_differs_from_single[k2]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_kvariant_double_differs_from_single[k3]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_partitioned_layout_differs_from_standard[seed0]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_partitioned_layout_differs_from_standard[seed3]", + "eval.tests.test_hash_h3_full_byte_and_seed.test_partitioned_layout_is_deterministic", + "eval.tests.test_hash_h3_full_byte_and_seed.test_same_byte_different_suffix_are_distinct_members", + "eval.tests.test_hash_hasher_composition.test_composition_deterministic_across_runs", + "eval.tests.test_hash_hasher_composition.test_double_hasher_fp_by_k[k1]", + "eval.tests.test_hash_hasher_composition.test_double_hasher_fp_by_k[k2]", + "eval.tests.test_hash_hasher_composition.test_double_hasher_fp_by_k[k3]", + "eval.tests.test_hash_hasher_composition.test_double_hasher_fp_by_k[k5]", + "eval.tests.test_hash_hasher_composition.test_double_hasher_fp_by_k[k8]", + "eval.tests.test_hash_hasher_composition.test_double_hashing_differs_from_single[k2]", + "eval.tests.test_hash_hasher_composition.test_double_hashing_differs_from_single[k3]", + "eval.tests.test_hash_hasher_composition.test_double_hashing_differs_from_single[k5]", + "eval.tests.test_hash_hasher_composition.test_double_hashing_differs_from_single[k8]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k1]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k2]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k3]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k4]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k5]", + "eval.tests.test_hash_hasher_composition.test_seed_changes_collision_layout[k6]", + "eval.tests.test_hash_hasher_composition.test_single_hasher_fp_by_k[k1]", + "eval.tests.test_hash_hasher_composition.test_single_hasher_fp_by_k[k2]", + "eval.tests.test_hash_hasher_composition.test_single_hasher_fp_by_k[k3]", + "eval.tests.test_hash_hasher_composition.test_single_hasher_fp_by_k[k5]", + "eval.tests.test_hash_hasher_composition.test_single_hasher_fp_by_k[k8]", + "eval.tests.test_hash_hasher_composition.test_single_vs_double_fp_sequence", + "eval.tests.test_hash_too_large.test_36_vs_37_boundary_is_off_by_one", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[basic-s17]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[basic-s1]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[basic-s35]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[basic-s36]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[basic-s5]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[counting-s17]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[counting-s1]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[counting-s35]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[counting-s36]", + "eval.tests.test_hash_too_large.test_boundary_ok_up_to_36[counting-s5]", + "eval.tests.test_hash_too_large.test_numeric_mode_hashes_double_and_finds_self[alpha]", + "eval.tests.test_hash_too_large.test_numeric_mode_hashes_double_and_finds_self[decimal]", + "eval.tests.test_hash_too_large.test_numeric_mode_hashes_double_and_finds_self[max_double]", + "eval.tests.test_hash_too_large.test_numeric_mode_hashes_double_and_finds_self[tiny_double]", + "eval.tests.test_hash_too_large.test_numeric_mode_parses_oversized_token_not_hash_raw_line[s100]", + "eval.tests.test_hash_too_large.test_numeric_mode_parses_oversized_token_not_hash_raw_line[s200]", + "eval.tests.test_hash_too_large.test_numeric_mode_parses_oversized_token_not_hash_raw_line[s37]", + "eval.tests.test_hash_too_large.test_numeric_mode_parses_oversized_token_not_hash_raw_line[s50]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-a2]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-basic]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-bitwise]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-counting]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-spectral-mi]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s100-spectral-rm]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-a2]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-basic]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-bitwise]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-counting]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-spectral-mi]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s200-spectral-rm]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-a2]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-basic]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-bitwise]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-counting]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-spectral-mi]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s37-spectral-rm]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-a2]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-basic]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-bitwise]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-counting]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-spectral-mi]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_insert[s50-spectral-rm]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[a2]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[basic]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[bitwise]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[counting]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[spectral-mi]", + "eval.tests.test_hash_too_large.test_too_large_aborts_on_query[spectral-rm]", + "eval.tests.test_hash_too_large.test_too_large_double_hashing_aborts[s100]", + "eval.tests.test_hash_too_large.test_too_large_double_hashing_aborts[s200]", + "eval.tests.test_hash_too_large.test_too_large_double_hashing_aborts[s37]", + "eval.tests.test_hash_too_large.test_too_large_double_hashing_aborts[s50]" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [ + { + "name": "eval.tests.test_filters.test_short_option_embedded_value", + "reasons": [ + { + "id": "missing_fixture_assets", + "message": "pytest test references fixture assets that are not packaged", + "path": "eval/tests/test_filters.py", + "repair_hint": "Package referenced fixture, resource, golden, or test data files with the eval branch.", + "severity": "error", + "stage": "static_lint" + } + ] + } + ], + "tests": [ + "eval.tests.test_construction_errors.test_construction_diagnostic[args0-golden_outputs/err_basic_cells.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args1-golden_outputs/err_basic_k.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args2-golden_outputs/err_counting_width.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args3-golden_outputs/err_a2_capacity.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args4-golden_outputs/err_spectralrm_cells2.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args5-golden_outputs/err_spectralrm_width2.golden]", + "eval.tests.test_construction_errors.test_construction_diagnostic[args6-golden_outputs/err_spectralrm_k2.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args0-golden_outputs/err_missing_type.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args1-golden_outputs/err_missing_input.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args2-golden_outputs/err_missing_query.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args3-golden_outputs/err_cannot_read_input.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args4-golden_outputs/err_cannot_read_query.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args5-golden_outputs/err_ws_input.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args6-golden_outputs/err_invalid_type.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args7-golden_outputs/err_unknown_long.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args8-golden_outputs/err_unknown_short.golden]", + "eval.tests.test_errors.test_cli_diagnostic[args9-golden_outputs/err_option_value_required.golden]", + "eval.tests.test_errors.test_parse_diagnostic[args0-golden_outputs/err_too_many_values.golden]", + "eval.tests.test_errors.test_parse_diagnostic[args1-golden_outputs/err_not_an_option.golden]", + "eval.tests.test_errors.test_parse_diagnostic[args2-golden_outputs/err_illformed_specificiation.golden]", + "eval.tests.test_errors.test_parse_diagnostic[args3-golden_outputs/err_illformed_specification.golden]", + "eval.tests.test_filters.test_evaluation_table[args0-golden_outputs/basic_cells.golden]", + "eval.tests.test_filters.test_evaluation_table[args1-golden_outputs/counting_README.golden]", + "eval.tests.test_filters.test_evaluation_table[args2-golden_outputs/counting_w4.golden]", + "eval.tests.test_filters.test_evaluation_table[args3-golden_outputs/counting_doublehash.golden]", + "eval.tests.test_filters.test_evaluation_table[args4-golden_outputs/spectral_mi.golden]", + "eval.tests.test_filters.test_evaluation_table[args5-golden_outputs/spectral_rm.golden]", + "eval.tests.test_filters.test_evaluation_table[args6-golden_outputs/bitwise.golden]", + "eval.tests.test_filters.test_evaluation_table[args7-golden_outputs/a2.golden]", + "eval.tests.test_filters.test_short_option_embedded_value", + "eval.tests.test_help.test_help_flag_displays_usage[--help]", + "eval.tests.test_help.test_help_flag_displays_usage[-h]", + "eval.tests.test_help.test_no_args_displays_usage", + "eval.tests.test_numeric.test_numeric_table[args0-golden_outputs/numeric_basic.golden]", + "eval.tests.test_numeric.test_numeric_table[args1-golden_outputs/numeric_counting.golden]", + "eval.tests.test_numeric.test_numeric_table[args2-golden_outputs/numeric_spectralmi.golden]" + ] + } + }, + "commit": "4c9efc1a4db7ed1ccf54cf0bd3a3641ce579206c", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.6159500516564012, + "eval_clean_hashes": [ + "73e634d124887b7563135efa89993fb01d492ae4fef21642f59f58cb91e05fa1" + ], + "input_record": { + "commit": "4c9efc1a4db7ed1ccf54cf0bd3a3641ce579206c", + "difficulty": "easy", + "difficulty_code_lines": 2065, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 2065, + "difficulty_runtime_deps": 1, + "difficulty_score": 1.6159500516564012, + "difficulty_test_code_lines": 2457, + "full_name": "mavam/libbf", + "input_joern_zip": "cpp_joern/mavam__libbf.zip", + "joern_status": true, + "joern_time": 5.358428024919704, + "language": "cpp", + "pb_match": [ + { + "pb_fullname": "ninja-build/ninja", + "rank": 903, + "similarity": 0.42701995372772217 + } + ], + "repo_path": "cpp/mavam__libbf", + "source": "commit:4c9efc1a4db7ed1ccf54cf0bd3a3641ce579206c", + "status": "done", + "url": "https://github.com/mavam/libbf" + }, + "instance_id": "mavam__libbf.4c9efc1", + "language": "cpp", + "module_iterations": [ + { + "actual_iterations": 5, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "max_iterations" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 4, + "module_kind": "tests", + "termination_reason": "max_iterations" + } + ], + "repository": "mavam/libbf" +} diff --git a/mavam--libbf.4c9efc1/tests/test.sh b/mavam--libbf.4c9efc1/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/mavam--libbf.4c9efc1/tests/workspace.tar.gz b/mavam--libbf.4c9efc1/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f4d1e8c864100976fa14e5834d9832c3258a5b36 --- /dev/null +++ b/mavam--libbf.4c9efc1/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:468cdf4a1f61469d2d29130c5a7961e8ea5660fd15b451a222603b5eae8e2c14 +size 2887 diff --git a/max-rocket-internet--k8s-event-l/environment/Dockerfile b/max-rocket-internet--k8s-event-l/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18c9b14a3dd87ff70c68d67e0e9cd3cb548e1b1a --- /dev/null +++ b/max-rocket-internet--k8s-event-l/environment/Dockerfile @@ -0,0 +1,60 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/max-rocket-internet--k8s-event-l/environment/download.sh b/max-rocket-internet--k8s-event-l/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..863f48342f2b45d5f5e31191d7b9ec490de0a752 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/environment/download.sh @@ -0,0 +1,230 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/max-rocket-internet/k8s-event-logger + +go 1.24.0 + +require ( + k8s.io/api v0.33.3 + k8s.io/apimachinery v0.33.3 + k8s.io/client-go v0.33.3 +) + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/gnostic-models v0.6.9 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/x448/float16 v0.8.4 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + golang.org/x/time v0.9.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= +github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/max-rocket-internet--k8s-event-l/environment/executable b/max-rocket-internet--k8s-event-l/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..279b44657b517b6d4b60f52b37f213a0cc69dd04 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:730594caa517808d1f25980024c6d23580f0f4f86cc3cc9f9e169f82916df754 +size 51504838 diff --git a/max-rocket-internet--k8s-event-l/environment/programgym-go.tar.gz b/max-rocket-internet--k8s-event-l/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/max-rocket-internet--k8s-event-l/environment/workspace.tar.gz b/max-rocket-internet--k8s-event-l/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..41299c951668eab950bbce6ce2350aded946e1d7 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a9af2b90d85fcd82c18a0bbb79e17a32bcd0a1325945845309206dbeb57247b +size 16649 diff --git a/max-rocket-internet--k8s-event-l/instruction.md b/max-rocket-internet--k8s-event-l/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/max-rocket-internet--k8s-event-l/solution/solve.sh b/max-rocket-internet--k8s-event-l/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/max-rocket-internet--k8s-event-l/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/max-rocket-internet--k8s-event-l/task.toml b/max-rocket-internet--k8s-event-l/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..530bd8a2fb9bb9c51e28eae7fa977ff0c0325208 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/max-rocket-internet--k8s-event-l" +description = "Synthetic ProgramGym cleanroom reconstruction task for max-rocket-internet/k8s-event-logger" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "max-rocket-internet__k8s-event-logger.caab565" +repository = "max-rocket-internet/k8s-event-logger" +commit = "caab565377b497032baab82b75fcca3c41cf4f17" +language = "go" +difficulty = "easy" +difficulty_score = 1.5422027824340283 +test_branches = 3 +test_count = 142 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/max-rocket-internet--k8s-event-l/tests/Dockerfile b/max-rocket-internet--k8s-event-l/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a626a06f42b7d18ca8dda5f990bed0106ab28bf5 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# programgym-runtime-workspace-cleanup: v1 +RUN ["bash","-lc","rm -f -- /workspace/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"] +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_01.tar.gz b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..efc297be7ab1f578e70ac0fc22fe2a0894e4e136 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:306046f30a6c27cf4959c66faed530f5c83d95494962e394ff1ee741ff669c81 +size 13251 diff --git a/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_02.tar.gz b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d601644b78ccb819f244424751a6441622ff6133 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9acaf8674e5567d669e3daaa3f969b359f33bfba2c37217577f822d3cb8712e1 +size 16285 diff --git a/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_upstream.tar.gz b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_upstream.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0f6f7c248d9c3ce0231200ae938355edac64131d --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/blobs/tests/generated_upstream.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89ed01a182160aac75600e0fdf7ccca703a97cffbd7201d5fc222eb1dd489338 +size 2052 diff --git a/max-rocket-internet--k8s-event-l/tests/download.sh b/max-rocket-internet--k8s-event-l/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..863f48342f2b45d5f5e31191d7b9ec490de0a752 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/download.sh @@ -0,0 +1,230 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/max-rocket-internet/k8s-event-logger + +go 1.24.0 + +require ( + k8s.io/api v0.33.3 + k8s.io/apimachinery v0.33.3 + k8s.io/client-go v0.33.3 +) + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/gnostic-models v0.6.9 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/x448/float16 v0.8.4 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect + golang.org/x/time v0.9.0 // indirect + google.golang.org/protobuf v1.36.5 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= +github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/max-rocket-internet--k8s-event-l/tests/executable b/max-rocket-internet--k8s-event-l/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..279b44657b517b6d4b60f52b37f213a0cc69dd04 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:730594caa517808d1f25980024c6d23580f0f4f86cc3cc9f9e169f82916df754 +size 51504838 diff --git a/max-rocket-internet--k8s-event-l/tests/programgym-go.tar.gz b/max-rocket-internet--k8s-event-l/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/max-rocket-internet--k8s-event-l/tests/programgym_evaluator.py b/max-rocket-internet--k8s-event-l/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/max-rocket-internet--k8s-event-l/tests/programgym_task.json b/max-rocket-internet--k8s-event-l/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..d1155fd7aa0076578c6c6c23b828db4415bd2187 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/programgym_task.json @@ -0,0 +1,238 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_flags.test_help_long_flag_prints_usage_to_stderr", + "eval.tests.test_cli_flags.test_help_prints_even_when_home_has_no_config", + "eval.tests.test_cli_flags.test_help_short_flag_h_behaves_like_help", + "eval.tests.test_cli_flags.test_ignore_normal_flag_accepted_blocks_and_clean_sigterm", + "eval.tests.test_cli_flags.test_invalid_boolean_flag_value_rejected", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[123abc]", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[2]", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[TRUEy]", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[[]", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[onx]", + "eval.tests.test_cli_flags.test_invalid_boolean_value_variants_rejected[yes]", + "eval.tests.test_cli_flags.test_unknown_flag_errors_and_names_the_flag", + "eval.tests.test_cli_flags.test_unknown_flag_that_shares_prefix_is_still_rejected", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[0]", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[1]", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[f]", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[false]", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[t]", + "eval.tests.test_cli_flags.test_valid_boolean_spellings_accepted[true]", + "eval.tests.test_kubeconfig_loading.test_empty_kubeconfig_env_panics", + "eval.tests.test_kubeconfig_loading.test_home_dot_kube_config_is_not_auto_discovered", + "eval.tests.test_kubeconfig_loading.test_kubeconfig_env_takes_only_source_of_truth_for_validation", + "eval.tests.test_kubeconfig_loading.test_kubernetes_master_alone_does_not_bypass_loading_rules", + "eval.tests.test_kubeconfig_loading.test_malformed_kubeconfig_yaml_panics_with_loading_error", + "eval.tests.test_kubeconfig_loading.test_missing_kubeconfig_vs_malformed_produce_distinct_stderr", + "eval.tests.test_kubeconfig_loading.test_no_kubeconfig_and_no_master_panics", + "eval.tests.test_kubeconfig_loading.test_nonexistent_kubeconfig_env_file_panics", + "eval.tests.test_kubeconfig_loading.test_valid_yaml_but_missing_current_context_panics", + "eval.tests.test_logevent_realtime.test_emitted_json_is_valid_and_well_typed", + "eval.tests.test_logevent_realtime.test_event_reason_and_action_preserved", + "eval.tests.test_logevent_realtime.test_filtering_is_per_event_not_batch", + "eval.tests.test_logevent_realtime.test_ignore_flag_filters_total_normal_count", + "eval.tests.test_logevent_realtime.test_ignored_events_never_create_stdout_garbage", + "eval.tests.test_logevent_realtime.test_ignored_normal_outside_flag_still_emits_with_flag_off", + "eval.tests.test_logevent_realtime.test_managed_fields_stripped_from_emitted_event", + "eval.tests.test_logevent_realtime.test_mixed_types_with_ignore_only_keeps_warnings", + "eval.tests.test_logevent_realtime.test_multiple_warning_events_emitted_in_watch_order", + "eval.tests.test_logevent_realtime.test_non_ignored_types_all_emitted_without_flag[Normal]", + "eval.tests.test_logevent_realtime.test_non_ignored_types_all_emitted_without_flag[Warning]", + "eval.tests.test_logevent_realtime.test_normal_event_filtered_when_ignore_flag", + "eval.tests.test_logevent_realtime.test_normal_event_logged_when_no_ignore_flag", + "eval.tests.test_logevent_realtime.test_note_field_round_trips_into_emitted_json", + "eval.tests.test_logevent_realtime.test_warning_always_logged_even_with_ignore_flag", + "eval.tests.test_logevent_realtime.test_warning_event_logged_as_json_to_stdout", + "eval.tests.test_runtime_shutdown.test_ignore_normal_false_blocks_and_clean_exit", + "eval.tests.test_runtime_shutdown.test_ignore_normal_true_blocks_and_clean_exit", + "eval.tests.test_runtime_shutdown.test_multiple_blocking_spawns_are_independent", + "eval.tests.test_runtime_shutdown.test_numeric_bool_spellings_reach_runtime", + "eval.tests.test_runtime_shutdown.test_reflector_reports_connection_failure_but_process_stays", + "eval.tests.test_runtime_shutdown.test_valid_kubeconfig_blocks_until_sigint", + "eval.tests.test_runtime_shutdown.test_valid_kubeconfig_blocks_until_sigterm" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_args.test_boolean_with_wrong_arg_form_rejected", + "eval.tests.test_cli_args.test_flag_after_positional_still_parsed", + "eval.tests.test_cli_args.test_help_flag_exits_zero_and_shows_usage[--help]", + "eval.tests.test_cli_args.test_help_flag_exits_zero_and_shows_usage[-h]", + "eval.tests.test_cli_args.test_help_flag_exits_zero_and_shows_usage[-help]", + "eval.tests.test_cli_args.test_help_flag_wins_over_ignore_normal", + "eval.tests.test_cli_args.test_help_mentions_ignore_normal_semantics", + "eval.tests.test_cli_args.test_ignore_normal_double_and_single_dash_parse[--ignore-normal]", + "eval.tests.test_cli_args.test_ignore_normal_double_and_single_dash_parse[-ignore-normal]", + "eval.tests.test_cli_args.test_ignore_normal_equals_false_parses_to_config_phase", + "eval.tests.test_cli_args.test_ignore_normal_equals_true_parses_to_config_phase", + "eval.tests.test_cli_args.test_ignore_normal_is_boolean_flag_shown_in_usage", + "eval.tests.test_cli_args.test_malformed_boolean_value_rejected", + "eval.tests.test_cli_args.test_positional_args_do_not_break_flag_parse", + "eval.tests.test_cli_args.test_single_dash_double_dash_unknown_both_error", + "eval.tests.test_cli_args.test_stdout_empty_when_help_requested", + "eval.tests.test_cli_args.test_unknown_flag_reported_and_exits_two[--bogus]", + "eval.tests.test_cli_args.test_unknown_flag_reported_and_exits_two[--definitely-not-a-flag]", + "eval.tests.test_cli_args.test_unknown_flag_reported_and_exits_two[-x]", + "eval.tests.test_cli_args.test_unknown_flag_wins_over_ignore_normal", + "eval.tests.test_config_errors.test_help_exits_zero_before_config_lookup[--help]", + "eval.tests.test_config_errors.test_help_exits_zero_before_config_lookup[-h]", + "eval.tests.test_config_errors.test_kubeconfig_directory_path_reports_read_error", + "eval.tests.test_config_errors.test_kubeconfig_invalid_yaml_reports_load_error", + "eval.tests.test_config_errors.test_kubeconfig_is_empty_file", + "eval.tests.test_config_errors.test_kubeconfig_kind_wrong_schema", + "eval.tests.test_config_errors.test_kubeconfig_multipath_tolerates_missing_first", + "eval.tests.test_config_errors.test_kubeconfig_multipath_two_empty_both_loaded", + "eval.tests.test_config_errors.test_kubeconfig_non_empty_comment_only_yaml", + "eval.tests.test_config_errors.test_kubeconfig_path_does_not_exist", + "eval.tests.test_config_errors.test_missing_kubeconfig_panics_with_guidance", + "eval.tests.test_config_errors.test_panic_prints_timestamped_application_log", + "eval.tests.test_error_paths.test_empty_list_with_watch_events_still_streams", + "eval.tests.test_error_paths.test_empty_stream_emits_nothing", + "eval.tests.test_error_paths.test_list_upstream_500_reports_error_and_no_events", + "eval.tests.test_error_paths.test_malformed_eventtime_in_list_blocks_list", + "eval.tests.test_error_paths.test_malformed_eventtime_in_list_partial_block", + "eval.tests.test_error_paths.test_malformed_eventtime_in_watch_dropped", + "eval.tests.test_error_paths.test_unreachable_server_no_events_keeps_watching", + "eval.tests.test_error_paths.test_watch_upstream_400_keeps_list_events", + "eval.tests.test_event_filtering.test_all_events_emitted_as_json_lines", + "eval.tests.test_event_filtering.test_count_field_round_trips", + "eval.tests.test_event_filtering.test_each_line_is_parseable_json", + "eval.tests.test_event_filtering.test_empty_type_survives_and_is_omitted", + "eval.tests.test_event_filtering.test_event_fields_preserved_verbatim", + "eval.tests.test_event_filtering.test_event_namespace_preserved", + "eval.tests.test_event_filtering.test_ignore_normal_filters_every_normal_event", + "eval.tests.test_event_filtering.test_ignore_normal_keeps_warning_from_watch", + "eval.tests.test_event_filtering.test_list_events_retain_kind_apiversion", + "eval.tests.test_event_filtering.test_managed_fields_stripped_from_output", + "eval.tests.test_event_filtering.test_mixed_stream_filtered_count", + "eval.tests.test_event_filtering.test_nonnormal_type_survives_ignore_normal[Info]", + "eval.tests.test_event_filtering.test_nonnormal_type_survives_ignore_normal[NORMAL]", + "eval.tests.test_event_filtering.test_nonnormal_type_survives_ignore_normal[Warning]", + "eval.tests.test_event_filtering.test_nonnormal_type_survives_ignore_normal[normal]", + "eval.tests.test_event_filtering.test_normal_event_emitted_without_ignore_flag", + "eval.tests.test_event_filtering.test_normal_type_is_filtered_by_ignore_normal", + "eval.tests.test_event_filtering.test_output_order_matches_stream_order", + "eval.tests.test_event_filtering.test_watch_events_lose_typemeta", + "eval.tests.test_ignore_flag_forms.test_double_dash_false_keeps_normal", + "eval.tests.test_ignore_flag_forms.test_double_dash_ignore_normal_filters", + "eval.tests.test_ignore_flag_forms.test_equals_true_form_filters_every_normal[--ignore-normal=true]", + "eval.tests.test_ignore_flag_forms.test_equals_true_form_filters_every_normal[-ignore-normal=true]", + "eval.tests.test_ignore_flag_forms.test_single_dash_ignore_normal_filters", + "eval.tests.test_serialization.test_action_round_trips", + "eval.tests.test_serialization.test_deprecated_count_positive_round_trips", + "eval.tests.test_serialization.test_deprecated_count_zero_is_omitted", + "eval.tests.test_serialization.test_deprecated_timestamps_round_trip", + "eval.tests.test_serialization.test_empty_name_is_omitted", + "eval.tests.test_serialization.test_empty_note_is_omitted", + "eval.tests.test_serialization.test_empty_reason_is_omitted", + "eval.tests.test_serialization.test_event_time_preserved_verbatim", + "eval.tests.test_serialization.test_regarding_and_deprecated_source_round_trip", + "eval.tests.test_serialization.test_related_object_round_trips", + "eval.tests.test_serialization.test_reporting_instance_round_trips", + "eval.tests.test_watch_envelope.test_added_watch_event_logged", + "eval.tests.test_watch_envelope.test_deleted_of_store_present_object_not_relogged", + "eval.tests.test_watch_envelope.test_deleted_watch_event_suppressed", + "eval.tests.test_watch_envelope.test_mixed_added_and_deleted", + "eval.tests.test_watch_envelope.test_modified_watch_event_delivered", + "eval.tests.test_watch_streams.test_added_of_store_present_object_not_relogged", + "eval.tests.test_watch_streams.test_list_rows_then_watch_rows_preserved_in_order", + "eval.tests.test_watch_streams.test_many_distinct_watch_adds_all_emitted_in_order", + "eval.tests.test_watch_streams.test_modified_of_store_present_object_not_relogged", + "eval.tests.test_watch_streams.test_repeated_identical_after_duplicate_keeps_single_line", + "eval.tests.test_watch_streams.test_watch_add_of_normal_filtered_by_ignore_normal", + "eval.tests.test_watch_streams.test_watch_add_of_warning_kept_by_ignore_normal" + ] + }, + "generated_upstream": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_contracts.test_help_documents_ignore_normal_flag", + "eval.tests.test_cli_contracts.test_ignore_normal_still_requires_cluster", + "eval.tests.test_cli_contracts.test_panics_without_kubeconfig", + "eval.tests.test_cli_contracts.test_unknown_flag_rejected" + ] + } + }, + "commit": "caab565377b497032baab82b75fcca3c41cf4f17", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.5422027824340283, + "eval_clean_hashes": [ + "730594caa517808d1f25980024c6d23580f0f4f86cc3cc9f9e169f82916df754" + ], + "input_record": { + "commit": "caab565377b497032baab82b75fcca3c41cf4f17", + "commits": 40, + "contributors": 15, + "difficulty": "easy", + "difficulty_code_lines": 85, + "difficulty_has_tests": true, + "difficulty_product_code_lines": 85, + "difficulty_runtime_deps": 40, + "difficulty_score": 1.5422027824340283, + "difficulty_test_code_lines": 222, + "full_name": "max-rocket-internet/k8s-event-logger", + "github_stars": 266, + "input_joern_zip": "go_joern/max-rocket-internet__k8s-event-logger.zip", + "joern_status": true, + "joern_time": 10.001007611863315, + "language": "go", + "pb_match": [ + { + "pb_fullname": "sclevine/yj", + "rank": 851, + "similarity": 0.476665735244751 + }, + { + "pb_fullname": "rs/jplot", + "rank": 495, + "similarity": 0.5048123002052307 + } + ], + "repo_age": 7.15, + "repo_path": "go/max-rocket-internet__k8s-event-logger", + "source": "commit:caab565377b497032baab82b75fcca3c41cf4f17", + "status": "done", + "url": "https://github.com/max-rocket-internet/k8s-event-logger" + }, + "instance_id": "max-rocket-internet__k8s-event-logger.caab565", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 3, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + }, + { + "actual_iterations": 5, + "branch_name": "generated_upstream", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "tests", + "termination_reason": "early_stopping" + } + ], + "repository": "max-rocket-internet/k8s-event-logger" +} diff --git a/max-rocket-internet--k8s-event-l/tests/test.sh b/max-rocket-internet--k8s-event-l/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0 diff --git a/max-rocket-internet--k8s-event-l/tests/workspace.tar.gz b/max-rocket-internet--k8s-event-l/tests/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..41299c951668eab950bbce6ce2350aded946e1d7 --- /dev/null +++ b/max-rocket-internet--k8s-event-l/tests/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a9af2b90d85fcd82c18a0bbb79e17a32bcd0a1325945845309206dbeb57247b +size 16649 diff --git a/maxmind--geoip2-csv-converter.ee/environment/Dockerfile b/maxmind--geoip2-csv-converter.ee/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6f371332b0892136e00733449b81644d11444adf --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/environment/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor synthetic ProgramGym adapter: run the agent as an unprivileged user. +# Keep tool/runtime state under /home/agent and reserve /workspace for the +# submission handed to the separate verifier. Keep the reference executable +# execute-only; the oracle temporarily restores owner read permission. +RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent +RUN mkdir -p /home/agent \ + && chown -R agent:agent /home/agent /workspace \ + && chown agent:agent /workspace/executable \ + && chmod 111 /workspace/executable +ENV HOME=/home/agent +WORKDIR /workspace diff --git a/maxmind--geoip2-csv-converter.ee/environment/download.sh b/maxmind--geoip2-csv-converter.ee/environment/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..74143d3a1903a924c0b70084b0a550ea3f01059b --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/environment/download.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maxmind/geoip2-csv-converter + +go 1.25.0 + +require ( + github.com/stretchr/testify v1.11.1 + go4.org/netipx v0.0.0-20231129151722-fdeea329fbba +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M= +go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maxmind--geoip2-csv-converter.ee/environment/executable b/maxmind--geoip2-csv-converter.ee/environment/executable new file mode 100644 index 0000000000000000000000000000000000000000..e433927faddc0d8160339d1ede8039b2b08ef73c --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/environment/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:366a4c3584127927eb3b1bc6065b8ef73c4a4e5a83a9cb568a6c32c2e947b08f +size 2820028 diff --git a/maxmind--geoip2-csv-converter.ee/environment/programgym-go.tar.gz b/maxmind--geoip2-csv-converter.ee/environment/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/environment/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maxmind--geoip2-csv-converter.ee/environment/workspace.tar.gz b/maxmind--geoip2-csv-converter.ee/environment/workspace.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ec0a5372e47fd88e8d3a613a4cbd526a8ea84b4a --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/environment/workspace.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4730bc2c0c399f326b86f56525eac590da31473d8fbeb806dd03910e07430992 +size 6315 diff --git a/maxmind--geoip2-csv-converter.ee/instruction.md b/maxmind--geoip2-csv-converter.ee/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..28d5b15c340df3494d7000811f8fe84ed15e19f2 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/instruction.md @@ -0,0 +1,98 @@ +You are a helpful assistant that can interact with a computer. + +This is a reverse-engineering benchmark. You are given a compiled binary and its documentation. +Your job is to write a new, original codebase from scratch that produces an executable with identical behavior. +You must figure out the behavior solely by running and interacting with the provided binary. +Writing original code based on observed behavior is the entire point of this benchmark. + +Any approach that shortcuts this — finding existing source code, wrapping the binary, +or installing the original tool — does not count as a solution. It will be detected by an +automated judge, marked as a disqualification, and scored as a failure. +The trace will be posted to an online wall of shame. + + +## What is not allowed + +### 1. Obtaining source code + +The only source of truth about what the executable does is the executable itself and its +bundled documentation. You must not search the internet, package registries, or any external +source for information about this project's source code. Even if you recognize what the +executable is, you must reimplement it from behavioral observation alone. + +This includes but is not limited to: +- Cloning or browsing the original GitHub repository, its forks, or mirrors +- Downloading the project from package registries: `cargo install `, `go get github.com//`, `pip install `, `apt-get source `, `npm install `, etc. +- Fetching source tarballs from project websites (e.g., `curl https://lua.org/ftp/lua-5.5.0.tar.gz`) +- 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/`) +- Searching the web for the project's source code or implementation details + +### 2. Wrapping or reusing the original binary + +Your submission must be a genuine reimplementation. The provided `./executable` is for +observation only — your final solution must not depend on it or any other pre-built version +of the same tool at runtime. + +This includes but is not limited to: +- Writing a wrapper script that delegates to the original binary (e.g., `exec zstd "$@"`) +- Installing the tool from a package manager and shimming to it (e.g., `apt-get install nnn && cp $(which nnn) ./executable`) +- Writing a `compile.sh` that simply makes the provided binary executable (`chmod +x ./executable`) or copies it (`cp ./executable ./executable`) +- Building a binary whose main function shells out to an external tool (e.g., `Command::new("miniserve").args(args).exec()`) +- Re-linking prebuilt `.o` object files found in the workspace without writing new source code + +### 3. Binary analysis of the provided executable + +All information about the provided `./executable` must be obtained by interacting with it +through its normal user interface (CLI flags, stdin/stdout, etc.). +- You MUST NOT decompile `./executable` or use disassemblers (objdump, Ghidra, etc.) on it +- You MUST NOT use strace, ltrace, or similar tracing/instrumentation tools on `./executable` + +Note: this restriction applies ONLY to the provided `./executable`. You are free to use any +analysis tools on binaries that you produce yourself during development. + +## What IS allowed + +- Running the executable with any inputs, flags, and arguments to observe its behavior +- Reading any documentation files bundled in the workspace + + +## Task context + +We want to write the source code for a given executable. +The executable is located at `./executable` in the workspace root. + +You also have access to the existing documentation. + +## Your task + +Implement the source code to generate an executable of exactly identical behavior as the original. + +No project-specific dependencies are pre-installed. +You do NOT have access to the internet. +**IMPORTANT**: Make sure that the executable(s) and everything else that is an artifact is not committed, i.e., is in your `.gitignore` file. +Finally, commit your changes. + +Make sure that you have a `./compile.sh` file that produces an executable `./executable` in the workspace root. +`compile.sh` should be executable and should install any dependencies needed to compile the executable. +If your compile.sh fails to compile on a fresh checkout, your task has failed. + +## Important: This is a reverse-engineering benchmark + +Your goal is to write original code from scratch that reproduces the executable's behavior. +The only way to learn what the executable does is to run it and read its bundled documentation. + +Any attempt to obtain source code — whether successful or not — or to wrap/reuse the +provided binary will be detected by an automated judge, disqualified, and scored as zero. +See the full rules in the system prompt above. Key points: + +- Do NOT search the internet, clone repos, or download the project from any package registry +- Do NOT wrap, shim, or delegate to the provided `./executable` or any installed version of the same tool +- Do NOT decompile the provided `./executable` or use strace/ltrace on it (analyzing your own binaries is fine) +- You SHOULD extensively test the executable to understand its behavior before writing code. + If you are dealing with a TUI, tmux/libtmux has been installed to help you test/inspect/it. + +## Recommended Workflow + +1. Explore all documentation files +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) +3. Write the source code to implement the behavior diff --git a/maxmind--geoip2-csv-converter.ee/solution/solve.sh b/maxmind--geoip2-csv-converter.ee/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a9bbc241bd1280a884f27762b502ff8f4c95635b --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/solution/solve.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Oracle-only ceiling check. The reference is execute-only for normal agents; +# because the oracle runs as the owning `agent` user it can temporarily add read +# permission and encode the binary for Harbor's normal artifact handoff. +set -euo pipefail +test -f ./executable +chmod u+r ./executable +python3 - <<'PY' +import base64 +from pathlib import Path + +Path(".programgym_oracle_reference").write_bytes( + base64.b64encode(Path("executable").read_bytes()) +) +PY +chmod u-r ./executable +cat > compile.sh <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +if [ -f ./.programgym_oracle_reference ]; then + python3 - <<'PY' +import base64 +from pathlib import Path + +Path("executable").write_bytes( + base64.b64decode(Path(".programgym_oracle_reference").read_bytes()) +) +PY +fi +test -f ./executable +chmod +x ./executable +EOF +chmod +x compile.sh diff --git a/maxmind--geoip2-csv-converter.ee/task.toml b/maxmind--geoip2-csv-converter.ee/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8fdaffe81743978ff1e31f26d0e518ace19b3699 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/task.toml @@ -0,0 +1,69 @@ +schema_version = "1.3" +source = "ProgramGym" +artifacts = [ + "/logs/verifier/programgym_eval.json", + "/logs/verifier/harbor_diagnostics.json", + "/logs/verifier/programgym_eval.log", + "/logs/verifier/reward.json", + "/logs/verifier/reward.txt", + # Keep agent/runtime state out of the submission handoff. In particular, + # Claude Code installs an absolute symlink under .local/bin; transferring it + # makes Python's safe tar extraction reject the entire workspace archive. + { source = "/workspace", exclude = [ + "executable", + ".git", + ".bashrc", + ".cache", + ".cc-switch", + ".claude", + ".local", + ] }, +] + +[task] +name = "programgym/maxmind--geoip2-csv-converter.ee" +description = "Synthetic ProgramGym cleanroom reconstruction task for maxmind/geoip2-csv-converter" +authors = [{ name = "Harbor ProgramGym Synthetic Adapter" }] +keywords = ["programgym", "synthetic", "reverse-engineering", "cleanroom", "go"] + +[metadata] +source = "ProgramGym" +instance_id = "maxmind__geoip2-csv-converter.ee705d4" +repository = "maxmind/geoip2-csv-converter" +commit = "ee705d4db504039d7ab598bac9e77987ed1e2e83" +language = "go" +difficulty = "easy" +difficulty_score = 1.279210512601395 +test_branches = 3 +test_count = 290 + +[agent] +timeout_sec = 14400 +user = "agent" +network_mode = "allowlist" +allowed_hosts = ["api.anthropic.com", "api.openai.com"] + +[verifier] +timeout_sec = 7200 +user = "root" +environment_mode = "separate" + +[verifier.env] +PROGRAMGYM_XDIST_WORKERS = "8" + +[verifier.environment] +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" + +[environment] +network_mode = "public" +build_timeout_sec = 1800 +cpus = 8 +memory_mb = 16384 +storage_mb = 30720 +gpus = 0 +workdir = "/workspace" diff --git a/maxmind--geoip2-csv-converter.ee/tests/Dockerfile b/maxmind--geoip2-csv-converter.ee/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bd5f12bacd787ef39a90a560bc0dec968dcdb06e --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/Dockerfile @@ -0,0 +1,66 @@ +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive +ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" +ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true +ENV GOPROXY="https://proxy.golang.org,direct" +ENV GOSUMDB=sum.golang.google.cn +ENV GOTOOLCHAIN=auto +ENV UV_INSECURE_HOST="" +ENV UV_INDEX_URL="https://pypi.org/simple" +ENV UV_EXTRA_INDEX_URL=https://pypi.org/simple +ENV UV_CACHE_DIR=/workspace/.cache/uv +ENV npm_config_registry="https://registry.npmjs.org/" +ENV npm_config_strict_ssl=false +ENV npm_config_cache=/workspace/.cache/npm +ENV PIP_INDEX_URL="https://pypi.org/simple" +ENV PIP_EXTRA_INDEX_URL=https://pypi.org/simple +ENV PIP_TRUSTED_HOST="" +ENV HOME=/workspace +ENV XDG_CACHE_HOME=/workspace/.cache +ENV PIP_CACHE_DIR=/workspace/.cache/pip +ENV PYTHONUSERBASE=/workspace/.local +ENV GOROOT=/usr/local/go +ENV GOPATH=/workspace/.go +ENV GOCACHE=/workspace/.cache/go-build +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +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 +ENV PAGER=cat +ENV MANPAGER=cat +ENV LESS=-R +ENV TQDM_DISABLE=1 +ENV VIRTUAL_ENV=/opt/programgym-venv +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/* +COPY programgym-go.tar.gz /tmp/programgym-go.tar.gz +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 +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 +WORKDIR /workspace +ADD workspace.tar.gz /workspace/ +COPY executable /workspace/executable +COPY download.sh /workspace/download.sh +RUN chmod 755 /workspace/download.sh +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"] +ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh +RUN chmod 111 /workspace/executable +WORKDIR /workspace +# Harbor uses tests/ as the separate verifier build context. Start with the +# same toolchain as the agent, then remove every cleanroom workspace artifact. +RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ + && mkdir -p /workspace /tests + +# Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. +# Installing a newer pytest alone leaves that apt package importable and creates +# an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). +# Install and constrain the verifier test runner as one coherent pip toolchain. +RUN printf 'pytest<9\n' > /etc/pip-constraint.txt +ENV PIP_CONSTRAINT=/etc/pip-constraint.txt +RUN python3 -m pip install --no-cache-dir --disable-pip-version-check \ + 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout + +COPY test.sh /tests/test.sh +COPY programgym_evaluator.py /tests/programgym_evaluator.py +COPY programgym_task.json /tests/programgym_task.json +COPY blobs/ /tests/blobs/ +RUN chmod +x /tests/test.sh diff --git a/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_01.tar.gz b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5774b2681ca162b276aa4121f98806851861b6ba --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_01.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9d5a10a4c393fc636364d5c33f1bb111bafcaa6afc498d8b38af7c6ab4da8cb +size 13876 diff --git a/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_02.tar.gz b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_02.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..34bc89ea8f67c42e09a04ab398d9ea7bdcf90049 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_02.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c242924c002eb3d3b9051e14febe22ebc7f7103cd396e14d562e122250d0b23c +size 11797 diff --git a/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_03.tar.gz b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_03.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9843cc611f96d52b2d8304b22d0e0e1b7401d875 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/blobs/tests/generated_module_03.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:771cb9f525374d49a8dca208edb8abcad30be29081fceefe3bf6b3096bc4b3d3 +size 8477 diff --git a/maxmind--geoip2-csv-converter.ee/tests/download.sh b/maxmind--geoip2-csv-converter.ee/tests/download.sh new file mode 100644 index 0000000000000000000000000000000000000000..74143d3a1903a924c0b70084b0a550ea3f01059b --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/download.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# PROGRAMGYM-MANAGED-GO-DOWNLOAD: v1 +# Generated deterministically from repository module metadata; do not edit. +set -u +export GOTOOLCHAIN=auto +mkdir -p /workspace/.programgym_build_env/go-prefetch +cat > /workspace/.programgym_build_env/go-prefetch/go.mod <<'PROGRAMGYM_GO_MOD_EOF' +module github.com/maxmind/geoip2-csv-converter + +go 1.25.0 + +require ( + github.com/stretchr/testify v1.11.1 + go4.org/netipx v0.0.0-20231129151722-fdeea329fbba +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) +PROGRAMGYM_GO_MOD_EOF +cat > /workspace/.programgym_build_env/go-prefetch/go.sum <<'PROGRAMGYM_GO_SUM_EOF' +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M= +go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +PROGRAMGYM_GO_SUM_EOF +PROGRAMGYM_GO_BASE_GOROOT="$(GOTOOLCHAIN=local go env GOROOT)" +if ! PROGRAMGYM_GO_RESOLVED_GOROOT="$(cd /workspace/.programgym_build_env/go-prefetch && GOTOOLCHAIN=auto go env GOROOT)"; then + printf '%s\n' 'download.sh: Go toolchain resolution failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi +if [ "$PROGRAMGYM_GO_RESOLVED_GOROOT" != "$PROGRAMGYM_GO_BASE_GOROOT" ]; then + PROGRAMGYM_GO_TOOLCHAIN_ROOT=/opt/programgym-go-toolchain + mkdir -p "$PROGRAMGYM_GO_TOOLCHAIN_ROOT" + cp -a "$PROGRAMGYM_GO_RESOLVED_GOROOT/." "$PROGRAMGYM_GO_TOOLCHAIN_ROOT/" + export GOROOT="$PROGRAMGYM_GO_TOOLCHAIN_ROOT" +else + export GOROOT="$PROGRAMGYM_GO_BASE_GOROOT" +fi +export PATH="$GOROOT/bin:$PATH" +export GOTOOLCHAIN=local +if ! (cd /workspace/.programgym_build_env/go-prefetch && go mod download -modfile=/workspace/.programgym_build_env/go-prefetch/go.mod all); then + printf '%s\n' 'download.sh: Go dependency prefetch failed' >&2 + if [ "${BASH_SOURCE[0]}" != "$0" ]; then + return 1 + else + exit 1 + fi +fi diff --git a/maxmind--geoip2-csv-converter.ee/tests/executable b/maxmind--geoip2-csv-converter.ee/tests/executable new file mode 100644 index 0000000000000000000000000000000000000000..e433927faddc0d8160339d1ede8039b2b08ef73c --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/executable @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:366a4c3584127927eb3b1bc6065b8ef73c4a4e5a83a9cb568a6c32c2e947b08f +size 2820028 diff --git a/maxmind--geoip2-csv-converter.ee/tests/programgym-go.tar.gz b/maxmind--geoip2-csv-converter.ee/tests/programgym-go.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0532cfb0397c6d86ac290d2a8c6843ef8e985e31 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/programgym-go.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39042a078ea9ceebe3ecda4a7188f0f5b96e14a071d27923ba7f40b456e85ae3 +size 59908810 diff --git a/maxmind--geoip2-csv-converter.ee/tests/programgym_evaluator.py b/maxmind--geoip2-csv-converter.ee/tests/programgym_evaluator.py new file mode 100644 index 0000000000000000000000000000000000000000..541bda3a105013fbffd2e0d69261ed76b40a7992 --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/programgym_evaluator.py @@ -0,0 +1,1201 @@ +#!/usr/bin/env python3 +"""In-place ProgramGym evaluator. + +Mirrors ProgramGym's ``Evaluator`` pipeline as closely as a single-container, +no-Docker-in-Docker host allows. Run from ``tests/test.sh`` inside the agent's +cleanroom container after Harbor flips the verifier-phase network policy. + +Differences from ``programgym.eval.eval.Evaluator`` that are structural to +running in one container: + +* No fresh container per branch. ``snapshot_workspace`` / ``restore_workspace`` + copy a post-compile workspace snapshot to a temp directory and restore it + before each branch; ``cleanup_lingering_processes`` kills leftover branch + processes between attempts to approximate the fresh-container boundary. +* No ``docker commit``. The post-compile workspace snapshot serves the same + role as the committed image upstream. +* Hidden test blobs are fetched on demand from HuggingFace via + ``huggingface_hub.snapshot_download`` (matching ``programgym.utils.blob_store``) + rather than being pre-staged into ``/tests/blobs/``. Override with + ``PROGRAMGYM_BLOB_DIR`` for offline reruns. + +Everything else (eval_clean_hashes scrub, deterministic synthetic git seed, +``compile.sh`` then stash + hash the executable, best-effort +``pytest-rerunfailures``, per-branch test-tar overlay, executable hash +``--max-worker-restart=4``, xdist worker-crash retry with serial fallback, +best-of-N attempt selection, active vs ignored test bookkeeping, scoring) is +preserved. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import re +import shlex +import shutil +import signal +import subprocess +import tempfile +import time +import traceback +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +WORKSPACE = Path(os.environ.get("PROGRAMGYM_WORKSPACE", "/workspace")) +STASHED_EXECUTABLE = Path("/opt/programgym-stashed-executable-do-not-modify") +METADATA_PATH = Path( + os.environ.get("PROGRAMGYM_METADATA", "/tests/programgym_task.json") +) +LOG_DIR = Path(os.environ.get("PROGRAMGYM_LOG_DIR", "/logs/verifier")) +WORKER_CRASH_PHRASE = "worker '" +XDIST_COLLAPSE_MARKERS = ( + "maximum crashed workers reached", + "xdist: maximum crashed", +) + +DEFAULT_HF_REPO_ID = "programgym/ProgramGym-Tests" +DEFAULT_HF_REVISION = "main" + +# Oracle agent handoff files (see solution/solve.sh). Must not appear in the +# post-compile workspace snapshot or they pollute tree-scanning tests (dutree). +_ORACLE_HANDOFF_NAMES = (".programgym_oracle_reference",) + +_TOOLCHAIN_BIN_DIR_CANDIDATES = ( + "/usr/local/go/bin", + "/go/bin", + "/usr/local/cargo/bin", + "/root/.cargo/bin", + "/root/.ghcup/bin", +) + + +def toolchain_bin_dirs() -> list[str]: + """Return toolchain bin directories that exist on this image.""" + candidates = list(_TOOLCHAIN_BIN_DIR_CANDIDATES) + candidates.extend( + str(path) + for path in sorted(Path("/usr/lib").glob("go-*/bin")) + if _is_accessible_dir(path) + ) + seen: set[str] = set() + present: list[str] = [] + for path in candidates: + if path in seen: + continue + seen.add(path) + if _is_accessible_dir(path): + present.append(path) + return present + + +def _is_accessible_dir(path: str | Path) -> bool: + """Return whether path is a directory without failing on protected homes.""" + try: + return Path(path).is_dir() + except OSError: + return False + + +def bootstrap_toolchain_path() -> str: + """Prepend discovered toolchain dirs to PATH (idempotent).""" + prepend = toolchain_bin_dirs() + current_parts = [part for part in os.environ.get("PATH", "").split(":") if part] + merged: list[str] = [] + for path in prepend + current_parts: + if path not in merged: + merged.append(path) + new_path = ":".join(merged) + os.environ["PATH"] = new_path + return new_path + + +def _bash_login_command(command: str) -> str: + """Run ``command`` under bash -lc with an explicit PATH export.""" + path = bootstrap_toolchain_path() + return f"export PATH={shlex.quote(path)}; {command}" + + +def sha256(path: Path) -> str: + h = hashlib.sha256() + with path.open("rb") as f: + for chunk in iter(lambda: f.read(1024 * 1024), b""): + h.update(chunk) + return h.hexdigest() + + +def write_json(path: Path, data: dict[str, Any]) -> None: + tmp = path.with_suffix(path.suffix + ".tmp") + tmp.write_text(json.dumps(data, indent=2, sort_keys=True)) + tmp.replace(path) + + +def _read_log_tail(path: Path | None, max_bytes: int = 65536) -> str: + if path is None or not path.exists(): + return "" + data = path.read_bytes() + if len(data) <= max_bytes: + return data.decode(errors="replace") + return data[-max_bytes:].decode(errors="replace") + + +def _close_pipes(proc: subprocess.Popen[Any]) -> None: + for stream in (proc.stdout, proc.stderr): + if stream is not None: + try: + stream.close() + except OSError: + pass + + +def _terminate_process_tree(proc: subprocess.Popen[Any]) -> None: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + proc.kill() + except ProcessLookupError: + pass + + +_PKILL_PATTERNS = ( + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + "tail -f", + "development.log", + " less ", + " less$", + "/less ", +) + + +def _pkill_aggressive() -> str: + """Best-effort kill of branch pytest/subprocess trees (Modal gVisor fallback).""" + notes: list[str] = [] + workspace = str(WORKSPACE) + patterns = list(_PKILL_PATTERNS) + [ + f"pytest.*{workspace}", + f"xdist.*{workspace}", + ] + for pattern in patterns: + result = subprocess.run( + ["pkill", "-9", "-f", pattern], + capture_output=True, + text=True, + ) + notes.append(f"pkill -9 -f {pattern!r}: rc={result.returncode}") + return "\n".join(notes) + + +def run_step( + command: str, + cwd: Path, + *, + timeout: int, + env: dict[str, str] | None = None, + step: str, + accept_failure: bool = False, + log_output: bool | None = None, + max_output_bytes: int = 65536, +) -> dict[str, Any]: + if log_output is None: + log_output = step == "run_tests" or timeout >= 60 + + started = time.monotonic() + stdout_path: Path | None = None + stderr_path: Path | None = None + stdout_f = None + stderr_f = None + + if log_output: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_id = f"{step}-{int(started * 1000)}" + stdout_path = LOG_DIR / f"run-step-{log_id}.stdout.log" + stderr_path = LOG_DIR / f"run-step-{log_id}.stderr.log" + stdout_f = stdout_path.open("w", encoding="utf-8") + stderr_f = stderr_path.open("w", encoding="utf-8") + popen_stdout: Any = stdout_f + popen_stderr: Any = stderr_f + else: + popen_stdout = subprocess.PIPE + popen_stderr = subprocess.PIPE + + proc = subprocess.Popen( + ["bash", "-lc", _bash_login_command(command)], + cwd=cwd, + env={**os.environ, **(env or {})}, + stdout=popen_stdout, + stderr=popen_stderr, + start_new_session=True, + text=True, + ) + timed_out = False + stdout = "" + stderr = "" + try: + if log_output: + proc.wait(timeout=timeout) + else: + stdout, stderr = proc.communicate(timeout=timeout) + except subprocess.TimeoutExpired: + timed_out = True + _terminate_process_tree(proc) + cleanup_lingering_processes(aggressive=True) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + if not log_output: + _close_pipes(proc) + finally: + if stdout_f is not None: + stdout_f.close() + if stderr_f is not None: + stderr_f.close() + + if timed_out: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = "" + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": 124, + "exception_info": f"timed out after {timeout}s", + } + else: + if log_output: + output = _read_log_tail(stdout_path, max_output_bytes) + _read_log_tail( + stderr_path, max_output_bytes + ) + else: + output = stdout + stderr + entry = { + "step": step, + "command": command, + "wall_time": time.monotonic() - started, + "output": output, + "returncode": proc.returncode, + "exception_info": "", + } + if entry["returncode"] and not accept_failure: + raise RuntimeError( + f"{step} failed: {entry['exception_info'] or entry['output']}" + ) + return entry + + +def cleanup_lingering_processes(*, aggressive: bool = False) -> dict[str, Any]: + started = time.monotonic() + patterns = [ + str(WORKSPACE / "executable"), + f"{WORKSPACE}/eval/", + f"{WORKSPACE}/tests/", + # lazygit --logs/-l tests spawn `tail -f` outside /workspace/. + "tail -f", + "development.log", + ] + killed: list[int] = [] + proc_root = Path("/proc") + proc_available = proc_root.exists() + if proc_available: + for proc_dir in proc_root.iterdir(): + if not proc_dir.name.isdigit(): + continue + pid = int(proc_dir.name) + if pid in {os.getpid(), os.getppid()}: + continue + try: + raw = (proc_dir / "cmdline").read_bytes() + except (FileNotFoundError, PermissionError, ProcessLookupError): + continue + cmdline = raw.replace(b"\0", b" ").decode(errors="replace") + if not any(pattern in cmdline for pattern in patterns): + continue + try: + os.kill(pid, signal.SIGKILL) + except (PermissionError, ProcessLookupError): + continue + killed.append(pid) + pkill_output = "" + if aggressive or not proc_available: + pkill_output = _pkill_aggressive() + output_parts = [] + if killed: + output_parts.append("\n".join(str(pid) for pid in killed)) + if pkill_output: + output_parts.append(pkill_output) + return { + "step": "cleanup_lingering_processes", + "command": "kill leftover branch processes referencing the workspace", + "wall_time": time.monotonic() - started, + "output": "\n".join(output_parts), + "returncode": 0, + "exception_info": "", + } + + +def extract_trusted_blob(tar_path: Path, dest: Path) -> None: + import tarfile + + with tarfile.open(tar_path, "r:gz") as tf: + try: + tf.extractall(dest, filter="fully_trusted") + except TypeError: + tf.extractall(dest) + + +def find_results_xml() -> Path | None: + """Return the junit xml path if pytest wrote one.""" + for candidate in (WORKSPACE / "eval" / "results.xml", WORKSPACE / "results.xml"): + if candidate.exists(): + return candidate + return None + + +def remove_oracle_handoff_artifacts() -> list[str]: + """Drop oracle-agent handoff files from /workspace before snapshot/restore.""" + removed: list[str] = [] + for name in _ORACLE_HANDOFF_NAMES: + path = WORKSPACE / name + if path.exists(): + if path.is_dir(): + shutil.rmtree(path) + else: + path.unlink() + removed.append(name) + return removed + + +def _remove_tree(path: Path) -> None: + """Remove a file or directory tree, with a shell fallback for overlay races.""" + if path.is_symlink() or path.is_file(): + path.unlink(missing_ok=True) + return + if not path.is_dir(): + path.unlink(missing_ok=True) + return + for attempt in range(3): + try: + shutil.rmtree(path) + if not path.exists(): + return + except OSError: + if attempt == 2: + run_step( + f"rm -rf {shlex.quote(str(path))}", + path.parent, + timeout=120, + step="clear_workspace_fallback", + accept_failure=True, + ) + if not path.exists(): + return + raise + + +def ensure_workspace_dir() -> None: + """Guarantee WORKSPACE exists as a writable directory (not a symlink/file).""" + if WORKSPACE.exists() and not WORKSPACE.is_dir(): + if WORKSPACE.is_symlink() or WORKSPACE.is_file(): + WORKSPACE.unlink() + else: + shutil.rmtree(WORKSPACE) + WORKSPACE.mkdir(parents=True, exist_ok=True) + + +def clear_workspace() -> None: + ensure_workspace_dir() + for path in list(WORKSPACE.iterdir()): + _remove_tree(path) + + +def restore_reference_executable() -> None: + """Write the stashed reference binary into /workspace after a branch overlay. + + Branch blobs may ship ``executable`` as a dangling symlink into + ``target/release/...``; ``shutil.copy2`` would follow it and raise + ``FileNotFoundError``. Drop whatever the blob left and copy the stashed + reference as a regular file. + """ + ensure_workspace_dir() + if not STASHED_EXECUTABLE.is_file(): + raise FileNotFoundError( + f"missing stashed reference executable at {STASHED_EXECUTABLE}" + ) + dest = WORKSPACE / "executable" + if dest.exists() or dest.is_symlink(): + if dest.is_dir(): + shutil.rmtree(dest) + else: + dest.unlink(missing_ok=True) + shutil.copy2(STASHED_EXECUTABLE, dest) + dest.chmod(0o755) + + +def snapshot_workspace(dest: Path) -> None: + if dest.exists(): + shutil.rmtree(dest) + shutil.copytree(WORKSPACE, dest, symlinks=True) + + +def restore_workspace(source: Path) -> None: + clear_workspace() + shutil.copytree(source, WORKSPACE, dirs_exist_ok=True, symlinks=True) + ensure_workspace_dir() + + +def remove_hashed_files(root: Path, hashes: set[str]) -> list[str]: + removed: list[str] = [] + for path in root.rglob("*"): + if path.is_file() and not path.is_symlink(): + try: + if sha256(path) in hashes: + path.unlink() + removed.append(str(path.relative_to(root))) + except OSError: + continue + return removed + + +def branch_tests(branch_info: dict[str, Any]) -> list[str]: + ignored = { + item["name"] for item in branch_info.get("ignored_tests", []) if "name" in item + } + return [name for name in branch_info.get("tests", []) if name not in ignored] + + +def ignored_tests(metadata: dict[str, Any]) -> set[str]: + result: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + result.update( + f"{branch}/{item['name']}" + for item in info.get("ignored_tests", []) + if "name" in item + ) + return result + + +def active_tests(metadata: dict[str, Any]) -> set[str]: + active: set[str] = set() + for branch, info in metadata.get("branches", {}).items(): + if info.get("ignored"): + continue + ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + active.update( + f"{branch}/{name}" for name in info.get("tests", []) if name not in ignored + ) + return active + + +def inject_not_run( + result: dict[str, Any], branch: str, tests: list[str], error_code: str +) -> None: + result["test_results"].extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": error_code}, + } + for name in tests + ) + + +def testcase_name(case: ET.Element) -> str: + classname = case.attrib.get("classname", "") + name = case.attrib.get("name", "") + return f"{classname}.{name}" if classname else name + + +# Only these tags under represent a result. / +# are stdout/stderr captures and must not be treated as results +# (a leading followed by would otherwise be classified +# as a stdout-only "passed"). +JUNIT_RESULT_TAGS = {"skipped", "failure", "error"} + + +def parse_junit( + raw_xml: str, branch: str, expected: list[str], ignored: set[str] +) -> tuple[list[dict[str, Any]], list[str]]: + root = ET.fromstring(raw_xml) + got: set[str] = set() + results: list[dict[str, Any]] = [] + for case in root.iter("testcase"): + name = testcase_name(case) + got.add(name) + extra: dict[str, Any] = {} + if "time" in case.attrib: + try: + extra["time"] = float(case.attrib["time"]) + except ValueError: + extra["time"] = case.attrib["time"] + result_children = [c for c in case if c.tag in JUNIT_RESULT_TAGS] + # Collapse duplicate same-tag result children. Pytest's + # "pytest.internal" pseudo-test sometimes emits two identical + # entries; treating that as a system_error would over-flag a real + # single failure. Mirrors upstream eval.py:816-820. + if len(result_children) > 1 and len({c.tag for c in result_children}) == 1: + result_children = [result_children[0]] + if not result_children: + status = "passed" + elif len(result_children) != 1: + status = "system_error" + extra["error_details"] = ( + f"Expected 1 result for {name}, got {len(result_children)}: " + f"{[c.tag for c in result_children]}" + ) + else: + first = result_children[0] + status = first.tag # "skipped" | "failure" | "error" + extra["message"] = first.attrib.get("message") or "" + if first.text: + extra["text"] = first.text + results.append( + {"name": name, "branch": branch, "status": status, "extra": extra} + ) + + active_expected = [name for name in expected if name not in ignored] + missing = [name for name in active_expected if name not in got] + results.extend( + { + "name": name, + "branch": branch, + "status": "not_run", + "extra": {"error_code": "missing_from_junit_xml"}, + } + for name in missing + ) + unexpected = got - set(expected) - ignored + warnings = ( + [f"Branch {branch}: {len(unexpected)} test(s) in JUnit XML not in tests.json"] + if unexpected + else [] + ) + return results, warnings + + +def count_worker_crashes(raw_xml: str) -> int: + if WORKER_CRASH_PHRASE not in raw_xml: + return 0 + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + crashes = 0 + for case in root.iter("testcase"): + for child in case: + text = (child.get("message") or "") + " " + (child.text or "") + if ( + child.tag in {"error", "failure"} + and WORKER_CRASH_PHRASE in text + and "crashed" in text + ): + crashes += 1 + break + return crashes + + +def run_output_indicates_xdist_collapse(output: str) -> bool: + lower = output.lower() + return any(marker in lower for marker in XDIST_COLLAPSE_MARKERS) + + +def count_junit_failures(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + failures = 0 + for case in root.iter("testcase"): + for child in case: + if child.tag in {"failure", "error"}: + failures += 1 + break + return failures + + +def count_junit_passed(raw_xml: str) -> int: + try: + root = ET.fromstring(raw_xml) + except ET.ParseError: + return 0 + passed = 0 + for case in root.iter("testcase"): + if not any(child.tag in JUNIT_RESULT_TAGS for child in case): + passed += 1 + return passed + + +def branch_attempt_metrics( + raw_xml: str, *, run_output: str, expected_tests: int +) -> tuple[int, int, int, int]: + """Return (crashes, n_testcases, failures, missing_from_xml).""" + crashes = count_worker_crashes(raw_xml) + if run_output_indicates_xdist_collapse(run_output): + crashes = max(crashes, 1) + n_tests = count_testcases(raw_xml) + failures = count_junit_failures(raw_xml) + missing = max(0, expected_tests - n_tests) + return crashes, n_tests, failures, missing + + +def needs_serial_retry( + *, + serial: bool, + crashes: int, + missing: int, + failures: int, + n_tests: int, + expected_tests: int, + run_output: str, +) -> bool: + if serial: + return False + high_failure_rate = ( + expected_tests > 0 and n_tests >= expected_tests and failures / n_tests >= 0.8 + ) + return ( + crashes > 0 + or missing > 0 + or high_failure_rate + or run_output_indicates_xdist_collapse(run_output) + ) + + +def count_testcases(raw_xml: str) -> int: + try: + return sum(1 for _ in ET.fromstring(raw_xml).iter("testcase")) + except ET.ParseError: + return 0 + + +def scored_results( + result: dict[str, Any], metadata: dict[str, Any] +) -> list[dict[str, Any]]: + active = active_tests(metadata) + by_key = { + f"{test['branch']}/{test['name']}": test + for test in result["test_results"] + if f"{test['branch']}/{test['name']}" in active + } + return [ + by_key.get( + key, + { + "branch": key.split("/", 1)[0], + "name": key.split("/", 1)[1], + "status": "not_run", + "extra": {"error_code": "missing_from_results"}, + }, + ) + for key in sorted(active) + ] + + +def summarize(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + # Multi-key reward: Harbor's default Mean aggregates each key independently + # (see harbor.metrics.base.aggregate_reward_dicts), so mean("resolved") is + # the proportion of tasks scoring a perfect pass-rate and mean of + # "almost_resolved" is the proportion scoring >= 0.95. "reward" stays the + # per-task pass-rate whose mean is the overall mean reward. + return { + "reward": pass_rate, + "resolved": 1.0 if pass_rate >= 1.0 else 0.0, + "almost_resolved": 1.0 if pass_rate >= 0.95 else 0.0, + } + + +def diagnostics(result: dict[str, Any], metadata: dict[str, Any]) -> dict[str, Any]: + scored = scored_results(result, metadata) + n_passed = sum(t["status"] == "passed" for t in scored) + n_tests = len(scored) + pass_rate = n_passed / n_tests if n_tests else 0.0 + return { + "pass_rate": pass_rate, + "resolved": int( + bool( + n_tests + and n_passed == n_tests + and not result["test_branch_errors"] + and not result["error_code"] + ) + ), + "n_passed": n_passed, + "n_tests": n_tests, + "n_branch_errors": len(result["test_branch_errors"]), + "infra_error": int(bool(result["error_code"] or result["test_branch_errors"])), + "executable_hash_present": int(bool(result.get("executable_hash"))), + } + + +def use_script_pty() -> bool: + return os.environ.get("PROGRAMGYM_SCRIPT_PTY", "").strip() == "1" + + +def script_pty_available() -> bool: + return shutil.which("script") is not None + + +def branch_env( + *, + serial: bool, + has_rerunfailures: bool, + extras: dict[str, str] | None = None, +) -> dict[str, str]: + addopts = ["--max-worker-restart=4"] + # A serial fallback is already a complete second execution. Re-running each + # failing test two more times makes large, failure-heavy suites prohibitively + # slow and adds little signal. + if has_rerunfailures and not serial: + addopts.extend(["--reruns=2", "--reruns-delay=1"]) + env = { + "PYTEST_ADDOPTS": " ".join(addopts), + # Match upstream non-TTY regression environments (dirble log format, etc.). + "NO_COLOR": "1", + "TERM": "dumb", + "CLICOLOR": "0", + "CLICOLOR_FORCE": "0", + "COLORTERM": "", + } + if extras: + env.update(extras) + xdist_workers = os.environ.get("PROGRAMGYM_XDIST_WORKERS") + if serial: + xdist_workers = "1" + if xdist_workers: + env["PYTEST_XDIST_AUTO_NUM_WORKERS"] = xdist_workers + return env + + +_SERIAL_RUN_SH = ".programgym_run_serial.sh" +# ``eval/run.sh`` usually passes ``-n auto`` on the command line, which overrides +# ``PYTEST_ADDOPTS``. Rewrite to ``-n 0`` in a verifier-local copy for retries. +_RUN_SH_XDIST_RE = re.compile(r"-n\s*(?:auto|\d+)") + + +def prepare_serial_run_sh(run_sh: Path) -> Path: + """Write a serial-only copy of ``eval/run.sh`` with xdist disabled.""" + serial_sh = run_sh.with_name(_SERIAL_RUN_SH) + patched = _RUN_SH_XDIST_RE.sub("-n 0", run_sh.read_text()) + serial_sh.write_text(patched) + serial_sh.chmod(0o755) + return serial_sh + + +def run_tests_command(*, serial: bool) -> str: + if serial: + inner = f"chmod +x ./eval/{_SERIAL_RUN_SH} && ./eval/{_SERIAL_RUN_SH}" + else: + inner = "chmod +x ./eval/run.sh && ./eval/run.sh" + if use_script_pty() and script_pty_available(): + return f"script -q -c {shlex.quote(inner)} /dev/null" + return inner + + +BAKED_BLOB_DIR = Path(os.environ.get("PROGRAMGYM_BAKED_BLOB_DIR", "/tests/blobs")) + + +def resolve_blob_dir(instance_id: str, metadata: dict[str, Any]) -> Path: + """Locate the per-instance blob directory. + + Resolution order: + + 1. ``/tests/blobs/`` if pre-fetched into the task at generation time + (``programgym-adapter --download-blobs``). Verifier-only mount, so + agent never sees these. + 2. ``PROGRAMGYM_BLOB_DIR`` env override pointing at an HF-cache-shaped + tree on disk (``//tests/.tar.gz``). Useful + for offline reruns sharing a cache across many tasks. + 3. ``huggingface_hub.snapshot_download`` from + ``programgym/ProgramGym-Tests`` (default repo, ``main`` revision). + + The returned directory contains ``tests/.tar.gz`` per active + branch — same shape as ``programgym/ProgramGym-Tests//`` + on HF. + """ + if BAKED_BLOB_DIR.exists() and (BAKED_BLOB_DIR / "tests").exists(): + return BAKED_BLOB_DIR + + local = os.environ.get("PROGRAMGYM_BLOB_DIR", "").strip() + if local: + candidate = Path(local) / instance_id + if candidate.exists(): + return candidate + raise FileNotFoundError( + f"PROGRAMGYM_BLOB_DIR set but {candidate} does not exist" + ) + + repo_id = os.environ.get("PROGRAMGYM_HF_REPO") or metadata.get( + "hf_repo_id", DEFAULT_HF_REPO_ID + ) + revision = os.environ.get("PROGRAMGYM_HF_REVISION") or metadata.get( + "hf_revision", DEFAULT_HF_REVISION + ) + + from huggingface_hub import snapshot_download + + cache_root = Path( + snapshot_download( + repo_id, + repo_type="dataset", + revision=revision, + allow_patterns=f"{instance_id}/**", + ) + ) + blob_dir = cache_root / instance_id + if not blob_dir.exists(): + raise FileNotFoundError( + f"HF blob directory missing for {instance_id} at {blob_dir}" + ) + return blob_dir + + +def evaluate(metadata: dict[str, Any]) -> dict[str, Any]: + bootstrap_toolchain_path() + branches = metadata.get("branches", {}) + active_branch_items = [ + (name, info) for name, info in branches.items() if not info.get("ignored") + ] + result: dict[str, Any] = { + "test_results": [], + "error_code": None, + "error_details": None, + "log": [], + "solution_branch": "submission", + "test_branches": [name for name, _ in active_branch_items], + "test_branch_errors": {}, + "executable_hash": None, + "warnings": [], + } + + instance_id = metadata["instance_id"] + + compile_timeout = int(os.environ.get("PROGRAMGYM_COMPILE_TIMEOUT", "900")) + branch_timeout = int(os.environ.get("PROGRAMGYM_BRANCH_TIMEOUT", "3600")) + + def fail_all(error_code: str, details: str) -> dict[str, Any]: + result["error_code"] = error_code + result["error_details"] = details + for branch, info in active_branch_items: + inject_not_run(result, branch, branch_tests(info), error_code) + return result + + with tempfile.TemporaryDirectory(prefix="programgym-eval-") as tmp: + compiled_snapshot = Path(tmp) / "compiled" + + started = time.monotonic() + removed = remove_hashed_files( + WORKSPACE, set(metadata.get("eval_clean_hashes", [])) + ) + result["log"].append( + { + "step": "remove_hashed_files", + "command": "remove files matching eval_clean_hashes", + "wall_time": time.monotonic() - started, + "output": "".join(f"removed '{path}'\n" for path in removed), + "returncode": 0, + "exception_info": "", + } + ) + + compile_sh = WORKSPACE / "compile.sh" + if not compile_sh.exists(): + return fail_all( + "missing_compile_sh", "submission did not contain compile.sh" + ) + + seed = ( + "if [ ! -d .git ]; then " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c init.defaultBranch=gold init -q && " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false add -A && " + "GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' " + "GIT_COMMITTER_DATE='2000-01-01T00:00:00Z' " + "git -c user.email=gold@local -c user.name=gold -c commit.gpgsign=false commit -q --allow-empty -m gold; " + "fi" + ) + try: + result["log"].append( + run_step(seed, WORKSPACE, timeout=300, step="seed_git") + ) + compile_log = run_step( + "chmod +x ./compile.sh && ./compile.sh", + WORKSPACE, + timeout=compile_timeout, + step="compile", + accept_failure=True, + ) + result["log"].append(compile_log) + if compile_log["returncode"]: + return fail_all("compile_failed", compile_log["output"]) + executable = WORKSPACE / "executable" + if not executable.exists(): + return fail_all( + "missing_executable", + "compile.sh completed but did not create ./executable", + ) + STASHED_EXECUTABLE.parent.mkdir(parents=True, exist_ok=True) + # `move` (not copy) so /workspace doesn't keep a parallel copy of + # the agent's executable during the stash→restore window. Mirrors + # upstream `mv ./executable {STASHED}` (eval.py:472). + shutil.move(str(executable), STASHED_EXECUTABLE) + result["executable_hash"] = sha256(STASHED_EXECUTABLE) + result["log"].append( + run_step( + "pip3 install -q --disable-pip-version-check pytest-rerunfailures", + WORKSPACE, + timeout=120, + step="install_rerunfailures", + accept_failure=True, + ) + ) + has_rerunfailures = result["log"][-1]["returncode"] == 0 + handoff_removed = remove_oracle_handoff_artifacts() + if handoff_removed: + result["log"].append( + { + "step": "remove_oracle_handoff", + "command": "remove oracle handoff artifacts from workspace", + "wall_time": 0.0, + "output": "".join( + f"removed '{name}'\n" for name in handoff_removed + ), + "returncode": 0, + "exception_info": "", + } + ) + snapshot_workspace(compiled_snapshot) + except Exception as exc: + return fail_all(type(exc).__name__, str(exc)) + + try: + blob_dir = resolve_blob_dir(instance_id, metadata) + except Exception as exc: + details = f"{type(exc).__name__}: {exc}" + for branch, info in active_branch_items: + result["test_branch_errors"][branch] = [ + { + "error_code": "blob_resolution_failed", + "error_details": details, + } + ] + inject_not_run( + result, branch, branch_tests(info), "blob_resolution_failed" + ) + return result + + for branch, info in active_branch_items: + tests = branch_tests(info) + blob = blob_dir / "tests" / f"{branch}.tar.gz" + if not blob.exists(): + result["test_branch_errors"][branch] = [ + {"error_code": "missing_test_blob", "error_details": blob.name} + ] + inject_not_run(result, branch, tests, "missing_test_blob") + continue + + best_xml = "" + # Prefer a complete, clean XML result, then the result covering the + # most expected tests, and only then the one with the most passes. + # Pass-count-only ranking can retain a partial xdist result over a + # complete serial result. + best_quality = (-1, -1, -1) + serial = bool(metadata.get("force_serial_branches")) + branch_log: list[dict[str, Any]] = [] + branch_ignored = { + item["name"] for item in info.get("ignored_tests", []) if "name" in item + } + n_expected = len([name for name in tests if name not in branch_ignored]) + + def merge_best_xml(raw_xml: str) -> None: + try: + parsed, warnings = parse_junit( + raw_xml, branch, list(info.get("tests", [])), branch_ignored + ) + except Exception as exc: + result["test_branch_errors"][branch] = [ + {"error_code": "xml_parse_error", "error_details": str(exc)} + ] + inject_not_run(result, branch, tests, "xml_parse_error") + else: + result["test_results"].extend(parsed) + result["warnings"].extend(warnings) + + while True: + branch_log.append(cleanup_lingering_processes()) + restore_workspace(compiled_snapshot) + extract_trusted_blob(blob, WORKSPACE) + restore_reference_executable() + actual_hash = sha256(WORKSPACE / "executable") + if actual_hash != result["executable_hash"]: + result["test_branch_errors"][branch] = [ + { + "error_code": "executable_hash_mismatch", + "error_details": ( + f"expected {result['executable_hash']}, got {actual_hash}" + ), + } + ] + inject_not_run(result, branch, tests, "executable_hash_mismatch") + break + run_sh = WORKSPACE / "eval" / "run.sh" + if not run_sh.exists(): + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_run_sh", + "error_details": "eval/run.sh missing", + } + ] + inject_not_run(result, branch, tests, "missing_run_sh") + break + # Upstream rewrites thread→signal so xdist workers fail cleanly + # instead of os._exit(1) on timeout. That works in fresh + # containers per branch; here we reuse one container and + # signal timeouts leave TUI/log-watcher subprocesses alive + # (e.g. lazygit --logs + tail -f), wedging pytest for up to + # branch_timeout. Keep the blob's thread method and rely on + # cleanup_lingering_processes + serial fallback after crashes. + env = branch_env( + serial=serial, + has_rerunfailures=has_rerunfailures, + extras=metadata.get("branch_env"), + ) + branch_log.append( + run_step( + "rm -f eval/results.xml results.xml", + WORKSPACE, + timeout=120, + step="clean_stale_results", + accept_failure=True, + ) + ) + if serial: + prepare_serial_run_sh(run_sh) + run_entry = run_step( + run_tests_command(serial=serial), + WORKSPACE, + timeout=branch_timeout, + env=env, + step="run_tests", + accept_failure=True, + ) + branch_log.append(run_entry) + branch_log.append(cleanup_lingering_processes()) + xml_path = find_results_xml() + if xml_path is None: + if best_xml: + merge_best_xml(best_xml) + break + if serial: + result["test_branch_errors"][branch] = [ + { + "error_code": "missing_results_xml", + "error_details": "eval/results.xml was not produced", + } + ] + inject_not_run(result, branch, tests, "missing_results_xml") + break + serial = True + continue + raw_xml = xml_path.read_text(errors="replace") + crashes, n_tests, failures, missing = branch_attempt_metrics( + raw_xml, + run_output=run_entry.get("output", ""), + expected_tests=n_expected, + ) + useful = count_junit_passed(raw_xml) + quality = ( + int(crashes == 0 and missing == 0), + n_tests, + useful, + ) + if quality > best_quality: + best_xml = raw_xml + best_quality = quality + retry = needs_serial_retry( + serial=serial, + crashes=crashes, + missing=missing, + failures=failures, + n_tests=n_tests, + expected_tests=n_expected, + run_output=run_entry.get("output", ""), + ) + if not retry: + merge_best_xml(best_xml) + break + serial = True + for entry in branch_log: + entry["branch"] = branch + result["log"].extend(branch_log) + + return result + + +def write_outputs(result: dict[str, Any], metadata: dict[str, Any]) -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + write_json(LOG_DIR / "programgym_eval.json", result) + write_json(LOG_DIR / "harbor_diagnostics.json", diagnostics(result, metadata)) + rewards = summarize(result, metadata) + write_json(LOG_DIR / "reward.json", rewards) + (LOG_DIR / "reward.txt").write_text(str(rewards["reward"])) + + +def main() -> None: + LOG_DIR.mkdir(parents=True, exist_ok=True) + log_path = LOG_DIR / "programgym_eval.log" + metadata = json.loads(METADATA_PATH.read_text()) + branches = metadata.get("branches", {}) + try: + result = evaluate(metadata) + except Exception as exc: + error_code = type(exc).__name__ + result = { + "test_results": [], + "error_code": error_code, + "error_details": str(exc), + "log": [ + { + "step": "evaluator_exception", + "exception_info": traceback.format_exc(), + "returncode": 1, + } + ], + "solution_branch": "submission", + "test_branches": [ + name for name, info in branches.items() if not info.get("ignored") + ], + "test_branch_errors": { + "__evaluator__": [{"error_code": error_code, "error_details": str(exc)}] + }, + "executable_hash": None, + "warnings": [], + } + for branch, info in branches.items(): + if info.get("ignored"): + continue + inject_not_run(result, branch, branch_tests(info), error_code) + log_path.write_text(traceback.format_exc()) + else: + log_path.write_text("") + write_outputs(result, metadata) + + +if __name__ == "__main__": + main() diff --git a/maxmind--geoip2-csv-converter.ee/tests/programgym_task.json b/maxmind--geoip2-csv-converter.ee/tests/programgym_task.json new file mode 100644 index 0000000000000000000000000000000000000000..f46bf54d8c3ced314aa5e21f643bd3cf507e31ae --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/programgym_task.json @@ -0,0 +1,416 @@ +{ + "branches": { + "generated_module_01": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_behavior_edge_cases.test_all_include_flags_explicit_false_still_errors", + "eval.tests.test_behavior_edge_cases.test_boolean_true_form_sets_the_matching_columns[-include-cidr=true-network,country]", + "eval.tests.test_behavior_edge_cases.test_boolean_true_form_sets_the_matching_columns[-include-hex-range=true-network_start_hex,network_last_hex,country]", + "eval.tests.test_behavior_edge_cases.test_boolean_true_form_sets_the_matching_columns[-include-integer-range=true-network_start_integer,network_last_integer,country]", + "eval.tests.test_behavior_edge_cases.test_boolean_true_form_sets_the_matching_columns[-include-range=true-network_start_ip,network_last_ip,country]", + "eval.tests.test_behavior_edge_cases.test_double_dash_long_flag_form_parses", + "eval.tests.test_behavior_edge_cases.test_false_cidr_excludes_its_column_when_range_enabled", + "eval.tests.test_behavior_edge_cases.test_flags_passed_line_sorted_alphabetically[cli_flags0-flags passed: -block-file, -include-cidr, -include-range, -output-file]", + "eval.tests.test_behavior_edge_cases.test_flags_passed_line_sorted_alphabetically[cli_flags1-flags passed: -block-file, -include-cidr, -include-hex-range, -include-integer-range, -output-file]", + "eval.tests.test_behavior_edge_cases.test_flags_passed_line_sorted_alphabetically[cli_flags2-flags passed: -block-file, -include-cidr, -output-file]", + "eval.tests.test_behavior_edge_cases.test_h_false_flag_still_displays_usage", + "eval.tests.test_behavior_edge_cases.test_help_false_flag_still_displays_usage", + "eval.tests.test_behavior_edge_cases.test_include_range_true_boolean_form", + "eval.tests.test_behavior_edge_cases.test_ipv6_all_four_include_flags_golden", + "eval.tests.test_behavior_edge_cases.test_ipv6_hex_range_matches_golden", + "eval.tests.test_behavior_edge_cases.test_ipv6_integer_range_matches_golden", + "eval.tests.test_behavior_edge_cases.test_nonexistent_output_directory_reports_creating_error", + "eval.tests.test_behavior_edge_cases.test_quoted_field_with_comma_preserved", + "eval.tests.test_behavior_edge_cases.test_second_run_overwrites_existing_output", + "eval.tests.test_behavior_edge_cases.test_single_32_range_start_equals_last", + "eval.tests.test_behavior_edge_cases.test_single_boolean_false_triggers_include_required", + "eval.tests.test_behavior_edge_cases.test_whitespace_only_block_file_passes_required_check", + "eval.tests.test_error_paths.test_empty_input_file_reports_header_eof", + "eval.tests.test_error_paths.test_error_reported_for_each_include_mode[flag_combo0]", + "eval.tests.test_error_paths.test_error_reported_for_each_include_mode[flag_combo1]", + "eval.tests.test_error_paths.test_error_reported_for_each_include_mode[flag_combo2]", + "eval.tests.test_error_paths.test_error_reported_for_each_include_mode[flag_combo3]", + "eval.tests.test_error_paths.test_malformed_network_named_in_error", + "eval.tests.test_error_paths.test_malformed_network_reports_parsing_error", + "eval.tests.test_error_paths.test_missing_input_error_exits_one", + "eval.tests.test_error_paths.test_missing_input_error_goes_to_stderr_not_stdout", + "eval.tests.test_error_paths.test_missing_input_file_reports_error", + "eval.tests.test_error_paths.test_output_file_left_partial_after_parse_error", + "eval.tests.test_error_paths.test_output_path_is_a_directory_reports_error", + "eval.tests.test_error_paths.test_relative_output_path_resolves_in_cwd", + "eval.tests.test_error_paths.test_unwritable_output_directory_reports_error", + "eval.tests.test_flag_parsing.test_bool_flag_boolean_form_accepted", + "eval.tests.test_flag_parsing.test_bool_flag_false_disables_conversion_flag", + "eval.tests.test_flag_parsing.test_flag_equals_form_parses_values", + "eval.tests.test_flag_parsing.test_flag_space_parses_values", + "eval.tests.test_flag_parsing.test_multiple_positional_args_joined_in_error", + "eval.tests.test_flag_parsing.test_positional_arg_first_stops_flag_parsing", + "eval.tests.test_flag_parsing.test_positional_arg_with_valid_flags_still_errors", + "eval.tests.test_flag_parsing.test_positional_args_reported_alongside_required_flag_errors", + "eval.tests.test_flag_parsing.test_single_positional_arg_reported_as_unknown", + "eval.tests.test_flag_parsing.test_unknown_flag_error_names_the_flag", + "eval.tests.test_flag_parsing.test_unknown_flag_prints_error_and_exit_2[--nope]", + "eval.tests.test_flag_parsing.test_unknown_flag_prints_error_and_exit_2[-blockfile]", + "eval.tests.test_flag_parsing.test_unknown_flag_prints_error_and_exit_2[-bogus]", + "eval.tests.test_flag_parsing.test_unknown_flag_prints_error_and_exit_2[-convert]", + "eval.tests.test_flag_parsing.test_unknown_flag_prints_error_and_exit_2[-x]", + "eval.tests.test_success_conversion.test_cidr_conversion_echoes_network_column", + "eval.tests.test_success_conversion.test_combined_include_columns_all_present", + "eval.tests.test_success_conversion.test_each_include_option_matches_golden[flags0-cidr_ipv4.csv]", + "eval.tests.test_success_conversion.test_each_include_option_matches_golden[flags1-range_ipv4.csv]", + "eval.tests.test_success_conversion.test_each_include_option_matches_golden[flags2-intrange_ipv4.csv]", + "eval.tests.test_success_conversion.test_each_include_option_matches_golden[flags3-hexrange_ipv4.csv]", + "eval.tests.test_success_conversion.test_each_include_option_matches_golden[flags4-all_ipv4.csv]", + "eval.tests.test_success_conversion.test_exit_zero_on_success", + "eval.tests.test_success_conversion.test_header_only_input_yields_header_only_output", + "eval.tests.test_success_conversion.test_header_only_with_range_adds_columns", + "eval.tests.test_success_conversion.test_hex_range_leading_zero_stripped", + "eval.tests.test_success_conversion.test_integer_range_big_endian_values", + "eval.tests.test_success_conversion.test_ipv6_cidr_conversion", + "eval.tests.test_success_conversion.test_ipv6_range_expands_to_full_subnet", + "eval.tests.test_success_conversion.test_multiple_distinct_output_files_each_written", + "eval.tests.test_success_conversion.test_output_file_is_created_and_nonempty", + "eval.tests.test_success_conversion.test_output_file_partial_line_preserved", + "eval.tests.test_success_conversion.test_range_conversion_adds_start_last_ip_columns", + "eval.tests.test_success_conversion.test_supplying_all_four_include_flags_many_combinations", + "eval.tests.test_usage_help.test_every_help_alias_prints_all_include_flags[--help]", + "eval.tests.test_usage_help.test_every_help_alias_prints_all_include_flags[-h]", + "eval.tests.test_usage_help.test_every_help_alias_prints_all_include_flags[-help]", + "eval.tests.test_usage_help.test_help_exits_zero_rather_than_error", + "eval.tests.test_usage_help.test_help_flag_prints_usage_to_stdout", + "eval.tests.test_usage_help.test_no_args_prints_usage_to_stderr", + "eval.tests.test_usage_help.test_no_args_usage_lists_all_flags", + "eval.tests.test_usage_help.test_short_h_flag_prints_usage", + "eval.tests.test_usage_help.test_usage_contains_input_output_required_notes", + "eval.tests.test_validation_errors.test_block_file_required_message", + "eval.tests.test_validation_errors.test_both_files_required_reported_together", + "eval.tests.test_validation_errors.test_each_missing_include_flag_triggers_required_error", + "eval.tests.test_validation_errors.test_empty_string_block_file_treated_as_missing", + "eval.tests.test_validation_errors.test_empty_string_output_file_treated_as_missing", + "eval.tests.test_validation_errors.test_equivalent_but_distinct_paths_are_allowed", + "eval.tests.test_validation_errors.test_error_precedes_usage_output", + "eval.tests.test_validation_errors.test_flags_passed_line_lists_set_flags_in_order", + "eval.tests.test_validation_errors.test_include_required_error_mentions_all_four_options", + "eval.tests.test_validation_errors.test_output_equals_input_error_message_exact", + "eval.tests.test_validation_errors.test_output_equals_input_is_rejected", + "eval.tests.test_validation_errors.test_output_file_required_message", + "eval.tests.test_validation_errors.test_validation_exits_one" + ] + }, + "generated_module_02": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_validation.TestHelp.test_help_flag_prints_usage_and_exits_zero[--help]", + "eval.tests.test_cli_validation.TestHelp.test_help_flag_prints_usage_and_exits_zero[-h]", + "eval.tests.test_cli_validation.TestHelp.test_help_output_mentions_required_annotations", + "eval.tests.test_cli_validation.TestOutputDiffersFromInput.test_output_equal_to_input_is_rejected", + "eval.tests.test_cli_validation.TestRequiredFlags.test_missing_block_file_only", + "eval.tests.test_cli_validation.TestRequiredFlags.test_missing_everything_reports_all_required_errors", + "eval.tests.test_cli_validation.TestRequiredFlags.test_missing_output_file_only", + "eval.tests.test_cli_validation.TestRequiredFlags.test_no_output_format_selected_is_rejected", + "eval.tests.test_cli_validation.TestUnknownArguments.test_known_flags_plus_positional_counted", + "eval.tests.test_cli_validation.TestUnknownArguments.test_multiple_positional_arguments_listed", + "eval.tests.test_cli_validation.TestUnknownArguments.test_positional_argument_rejected", + "eval.tests.test_cli_validation.TestUnknownFlag.test_unknown_flag_from_go_parser", + "eval.tests.test_cli_validation.TestUnknownFlag.test_unknown_flag_is_distinct_from_validation_failure", + "eval.tests.test_coverage_and_edges.TestAdditionalParseRejections.test_empty_network_cell_is_rejected", + "eval.tests.test_coverage_and_edges.TestAdditionalParseRejections.test_whitespace_surrounding_network_is_rejected", + "eval.tests.test_coverage_and_edges.TestCsvRoundTripEdges.test_crlf_input_all_formats_preserves_numeric_columns", + "eval.tests.test_coverage_and_edges.TestCsvRoundTripEdges.test_data_column_that_looks_like_a_network_is_preserved", + "eval.tests.test_coverage_and_edges.TestCsvRoundTripEdges.test_header_field_with_embedded_comma_is_re_quoted", + "eval.tests.test_coverage_and_edges.TestCsvRoundTripEdges.test_middle_empty_data_column_round_trips", + "eval.tests.test_coverage_and_edges.TestCsvRoundTripEdges.test_quoted_multiline_field_round_trips", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_cidr_column_echoes_host_bits[10.11.12.13/16-10.11.12.13/16]", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_cidr_column_echoes_host_bits[172.20.30.40/18-172.20.30.40/18]", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_cidr_column_echoes_host_bits[192.168.5.77/24-192.168.5.77/24]", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_int_range_start_reflects_host_bits", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_ipv6_host_bits_preserved_in_cidr", + "eval.tests.test_coverage_and_edges.TestHostBitsPreservation.test_range_start_uses_unmasked_address", + "eval.tests.test_coverage_and_edges.TestRawFormatDepth.test_ipv4_huge_class_a_network_integer_range", + "eval.tests.test_coverage_and_edges.TestRawFormatDepth.test_ipv6_mapped_low_network_hex_leading_zeros_trimmed", + "eval.tests.test_coverage_and_edges.TestRawFormatDepth.test_zero_prefix_hex_trims_single_leading_zero", + "eval.tests.test_coverage_and_edges.TestStatefulReConversion.test_cidr_output_can_be_reconverted_as_a_block_file", + "eval.tests.test_coverage_and_edges.TestStatefulReConversion.test_output_columns_are_all_valid_unsigned_integers", + "eval.tests.test_coverage_and_edges.TestWriterFailureBranch.test_flush_failure_reported_with_all_formats_armed", + "eval.tests.test_coverage_and_edges.TestWriterFailureBranch.test_flush_write_failure_reports_no_space_error", + "eval.tests.test_file_workflow.TestFullWorkflow.test_reformat_same_data_through_multiple_representations", + "eval.tests.test_file_workflow.TestHeaderColumnsPrepend.test_header_prepends_all_derived_columns_and_keeps_originals", + "eval.tests.test_file_workflow.TestOutputOverwrite.test_existing_output_file_is_overwritten", + "eval.tests.test_file_workflow.TestRepeatableConversion.test_row_order_is_preserved_from_input", + "eval.tests.test_file_workflow.TestRepeatableConversion.test_same_input_produces_identical_repeat_outputs", + "eval.tests.test_formats.TestCIDRFormat.test_cidr_only_produces_network_column", + "eval.tests.test_formats.TestCIDRFormat.test_cidr_value_is_the_canonical_prefix_string", + "eval.tests.test_formats.TestFormatComposition.test_all_four_formats_full_column_order", + "eval.tests.test_formats.TestFormatComposition.test_cidr_and_range_order", + "eval.tests.test_formats.TestFormatComposition.test_flag_order_on_command_line_does_not_change_column_order", + "eval.tests.test_formats.TestFormatComposition.test_int_and_hex_order", + "eval.tests.test_formats.TestGoldenAllFormats.test_sample_block_file_matches_golden", + "eval.tests.test_formats.TestHexRangeFormat.test_hex_leading_zero_byte_trimmed_for_small_ipv4", + "eval.tests.test_formats.TestHexRangeFormat.test_ipv4_hex_range", + "eval.tests.test_formats.TestHexRangeFormat.test_ipv6_hex_range_is_32_hex_digits", + "eval.tests.test_formats.TestIntegerRangeFormat.test_ipv4_integer_range", + "eval.tests.test_formats.TestIntegerRangeFormat.test_ipv6_integer_range_is_a_full_unsigned_128bit_value", + "eval.tests.test_formats.TestIntegerRangeFormat.test_max_ipv4_32bit_boundary", + "eval.tests.test_formats.TestIntegerRangeFormat.test_zero_network_integer_identity", + "eval.tests.test_formats.TestRangeFormat.test_dotted_decimals_are_not_lost_in_range", + "eval.tests.test_formats.TestRangeFormat.test_ipv4_range_columns", + "eval.tests.test_formats.TestRangeFormat.test_ipv6_range_columns_expand_to_full_host_bits", + "eval.tests.test_formats.TestRangeFormat.test_single_host_network_has_identical_start_and_last", + "eval.tests.test_io_errors.TestCsvParsing.test_numeric_data_columns_are_forwarded_verbatim", + "eval.tests.test_io_errors.TestCsvParsing.test_quoted_empty_field_is_emitted", + "eval.tests.test_io_errors.TestCsvParsing.test_quoted_field_with_embedded_comma_is_round_tripped", + "eval.tests.test_io_errors.TestCsvParsing.test_trailing_empty_column_round_trips", + "eval.tests.test_io_errors.TestErrorPaths.test_empty_input_file_fails_on_header_read", + "eval.tests.test_io_errors.TestErrorPaths.test_invalid_prefix_length_fails", + "eval.tests.test_io_errors.TestErrorPaths.test_malformed_network_in_data_row_fails", + "eval.tests.test_io_errors.TestErrorPaths.test_missing_input_file_fails_conversion", + "eval.tests.test_io_errors.TestErrorPaths.test_non_prefix_network_value_fails", + "eval.tests.test_io_errors.TestErrorPaths.test_row_with_fewer_columns_than_header_fails", + "eval.tests.test_io_errors.TestErrorPaths.test_unclosed_quoted_field_fails_csv_parse", + "eval.tests.test_io_errors.TestErrorPaths.test_unwritable_output_directory_fails_conversion", + "eval.tests.test_io_errors.TestFileSideEffects.test_output_file_created_with_content", + "eval.tests.test_io_errors.TestFileSideEffects.test_parse_error_still_creates_an_empty_output_file", + "eval.tests.test_io_errors.TestFileSideEffects.test_valid_conversion_output_is_csv_parseable", + "eval.tests.test_io_errors.TestIpFamilies.test_ipv4_mapped_into_ipv6_prefix_stays_v6", + "eval.tests.test_io_errors.TestIpFamilies.test_mixed_family_rows_each_convert[10.0.0.0/8-10.0.0.0/8]", + "eval.tests.test_io_errors.TestIpFamilies.test_mixed_family_rows_each_convert[172.16.0.0/12-172.16.0.0/12]", + "eval.tests.test_io_errors.TestIpFamilies.test_mixed_family_rows_each_convert[192.168.1.0/24-192.168.1.0/24]", + "eval.tests.test_io_errors.TestIpFamilies.test_mixed_family_rows_each_convert[::1/128-::1/128]", + "eval.tests.test_io_errors.TestIpFamilies.test_mixed_family_rows_each_convert[fe80::/10-fe80::/10]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv4_range_boundaries[0.0.0.0/0-0.0.0.0-255.255.255.255]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv4_range_boundaries[10.0.0.0/31-10.0.0.0-10.0.0.1]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv4_range_boundaries[128.0.0.0/1-128.0.0.0-255.255.255.255]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv4_range_boundaries[255.255.255.255/32-255.255.255.255-255.255.255.255]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv6_range_boundaries[8000::/1-8000::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv6_range_boundaries[::/0-::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_io_errors.TestNetworkBoundaries.test_ipv6_range_boundaries[::1/128-::1-::1]", + "eval.tests.test_io_errors.TestStructuralEdgeCases.test_header_only_input_yields_header_only_output", + "eval.tests.test_io_errors.TestStructuralEdgeCases.test_rfc4180_valid_crlf_line_endings", + "eval.tests.test_io_errors.TestStructuralEdgeCases.test_single_column_network_only" + ] + }, + "generated_module_03": { + "ignore_reason": "", + "ignored": false, + "ignored_tests": [], + "tests": [ + "eval.tests.test_cli_validation.test_double_dash_help_exits_zero", + "eval.tests.test_cli_validation.test_each_single_include_flag_is_accepted[-include-cidr]", + "eval.tests.test_cli_validation.test_each_single_include_flag_is_accepted[-include-hex-range]", + "eval.tests.test_cli_validation.test_each_single_include_flag_is_accepted[-include-integer-range]", + "eval.tests.test_cli_validation.test_each_single_include_flag_is_accepted[-include-range]", + "eval.tests.test_cli_validation.test_help_does_not_emit_required_errors", + "eval.tests.test_cli_validation.test_help_flag_exits_zero", + "eval.tests.test_cli_validation.test_missing_block_file_at_runtime", + "eval.tests.test_cli_validation.test_missing_block_file_reports_error", + "eval.tests.test_cli_validation.test_missing_include_flag_reports_error", + "eval.tests.test_cli_validation.test_missing_output_directory_runtime", + "eval.tests.test_cli_validation.test_missing_output_file_reports_error", + "eval.tests.test_cli_validation.test_multiple_unknown_positional_arguments", + "eval.tests.test_cli_validation.test_no_arguments_reports_all_required_flags", + "eval.tests.test_cli_validation.test_no_include_flag_with_only_cidr", + "eval.tests.test_cli_validation.test_same_input_and_output_rejected", + "eval.tests.test_cli_validation.test_same_input_and_output_relative_vs_absolute", + "eval.tests.test_cli_validation.test_unknown_positional_argument_rejected", + "eval.tests.test_cli_validation.test_unwritable_output_file_runtime", + "eval.tests.test_conversion_data.test_bom_prefixed_header", + "eval.tests.test_conversion_data.test_crlf_line_endings", + "eval.tests.test_conversion_data.test_embedded_quotes_escaped", + "eval.tests.test_conversion_data.test_empty_input_csv_reports_header_eof", + "eval.tests.test_conversion_data.test_empty_middle_field_preserved", + "eval.tests.test_conversion_data.test_empty_optional_field_preserved", + "eval.tests.test_conversion_data.test_header_only_input_produces_header_output", + "eval.tests.test_conversion_data.test_ipv4_prefix_length_must_be_network_bits", + "eval.tests.test_conversion_data.test_multiple_networks_all_converted_in_order", + "eval.tests.test_conversion_data.test_output_file_created_even_when_input_missing", + "eval.tests.test_conversion_data.test_output_file_created_with_content", + "eval.tests.test_conversion_data.test_output_truncated_on_rewrite", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[1.2.3.4/33]", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[1.2.3.4/99]", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[1.2.3.4]", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[2001:db8::/129]", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[999.1.1.1/24]", + "eval.tests.test_conversion_data.test_parse_prefix_error_aborts[notanetwork]", + "eval.tests.test_conversion_data.test_parse_prefix_error_is_partial_and_flushed", + "eval.tests.test_conversion_data.test_quoted_field_preserved", + "eval.tests.test_conversion_data.test_ragged_field_count_aborts[network,geo,cc\\n1.0.0.0/24,1,us\\n2.0.0.0/8,2\\n]", + "eval.tests.test_conversion_data.test_ragged_field_count_aborts[network,geo,extra\\n1.0.0.0/24\\n]", + "eval.tests.test_conversion_data.test_ragged_field_count_aborts[network,geo\\n1.0.0.0/24,1,extra\\n]", + "eval.tests.test_conversion_data.test_ragged_field_count_aborts[network,geo\\n1.0.0.0/24,1\\n2.0.0.0/8,2,3\\n]", + "eval.tests.test_conversion_data.test_spaces_in_non_network_field_preserved", + "eval.tests.test_conversion_data.test_whitespace_only_input_is_empty_header", + "eval.tests.test_conversion_formats.test_all_formats_row_content[0.0.0.0/0-0.0.0.0-255.255.255.255-0-4294967295-0000000-ffffffff]", + "eval.tests.test_conversion_formats.test_all_formats_row_content[1.0.0.0/24-1.0.0.0-1.0.0.255-16777216-16777471-1000000-10000ff]", + "eval.tests.test_conversion_formats.test_all_formats_row_content[10.0.0.0/8-10.0.0.0-10.255.255.255-167772160-184549375-a000000-affffff]", + "eval.tests.test_conversion_formats.test_all_formats_row_content[2001:4220::/32-2001:4220::-2001:4220:ffff:ffff:ffff:ffff:ffff:ffff-42541829336310884227257139937291534336-42541829415539046741521477530835484671-20014220000000000000000000000000-20014220ffffffffffffffffffffffff]", + "eval.tests.test_conversion_formats.test_all_formats_row_content[8.8.8.8/32-8.8.8.8-8.8.8.8-134744072-134744072-8080808-8080808]", + "eval.tests.test_conversion_formats.test_all_formats_row_content[::1/128-::1-::1-1-1-0000000000000000000000000000001-0000000000000000000000000000001]", + "eval.tests.test_conversion_formats.test_all_four_formats_column_order", + "eval.tests.test_conversion_formats.test_cidr_headers_and_rows", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[0.0.0.0/0]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[1.0.0.0/24]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[10.0.0.0/8]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[2001:4220::/32]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[2406:4000::/32]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[4.69.140.16/29]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[8.8.8.8/32]", + "eval.tests.test_conversion_formats.test_cidr_output_eqs_input_network[::1/128]", + "eval.tests.test_conversion_formats.test_flag_order_does_not_change_output", + "eval.tests.test_conversion_formats.test_hex_range_columns", + "eval.tests.test_conversion_formats.test_hex_range_values[0.0.0.0/0-0000000-ffffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[0.0.0.0/1-0000000-7fffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[1.0.0.0/24-1000000-10000ff]", + "eval.tests.test_conversion_formats.test_hex_range_values[10.0.0.0/8-a000000-affffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[169.254.0.0/16-a9fe0000-a9feffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[172.16.0.0/12-ac100000-ac1fffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[2001:4220::/32-20014220000000000000000000000000-20014220ffffffffffffffffffffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[2001:db8::/48-20010db8000000000000000000000000-20010db80000ffffffffffffffffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[255.255.255.255/32-ffffffff-ffffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[8.8.8.8/32-8080808-8080808]", + "eval.tests.test_conversion_formats.test_hex_range_values[::/0-0000000000000000000000000000000-ffffffffffffffffffffffffffffffff]", + "eval.tests.test_conversion_formats.test_hex_range_values[::1/128-0000000000000000000000000000001-0000000000000000000000000000001]", + "eval.tests.test_conversion_formats.test_hex_range_values[ff02::1/128-ff020000000000000000000000000001-ff020000000000000000000000000001]", + "eval.tests.test_conversion_formats.test_int_range_uses_first_and_last_ips", + "eval.tests.test_conversion_formats.test_integer_range_columns", + "eval.tests.test_conversion_formats.test_integer_range_values[0.0.0.0/0-0-4294967295]", + "eval.tests.test_conversion_formats.test_integer_range_values[0.0.0.0/1-0-2147483647]", + "eval.tests.test_conversion_formats.test_integer_range_values[1.0.0.0/24-16777216-16777471]", + "eval.tests.test_conversion_formats.test_integer_range_values[10.0.0.0/8-167772160-184549375]", + "eval.tests.test_conversion_formats.test_integer_range_values[169.254.0.0/16-2851995648-2852061183]", + "eval.tests.test_conversion_formats.test_integer_range_values[172.16.0.0/12-2886729728-2887778303]", + "eval.tests.test_conversion_formats.test_integer_range_values[2001:4220::/32-42541829336310884227257139937291534336-42541829415539046741521477530835484671]", + "eval.tests.test_conversion_formats.test_integer_range_values[2001:db8::/48-42540766411282592856903984951653826560-42540766411283801782723599580828532735]", + "eval.tests.test_conversion_formats.test_integer_range_values[255.255.255.255/32-4294967295-4294967295]", + "eval.tests.test_conversion_formats.test_integer_range_values[8.8.8.8/32-134744072-134744072]", + "eval.tests.test_conversion_formats.test_integer_range_values[::/0-0-340282366920938463463374607431768211455]", + "eval.tests.test_conversion_formats.test_integer_range_values[::1/128-1-1]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[0.0.0.0/0-0.0.0.0-255.255.255.255]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[0.0.0.0/1-0.0.0.0-127.255.255.255]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[192.168.1.7/32-192.168.1.7-192.168.1.7]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[255.255.255.255/32-255.255.255.255-255.255.255.255]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[::/0-::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_conversion_formats.test_range_boundary_prefixes[::1/128-::1-::1]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[1.0.0.0/24-1.0.0.0-1.0.0.255]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[10.0.0.0/8-10.0.0.0-10.255.255.255]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[169.254.0.0/16-169.254.0.0-169.254.255.255]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[172.16.0.0/12-172.16.0.0-172.31.255.255]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[2001:4220::/32-2001:4220::-2001:4220:ffff:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[2001:db8::/48-2001:db8::-2001:db8:0:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[2402:d000::/32-2402:d000::-2402:d000:ffff:ffff:ffff:ffff:ffff:ffff]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[4.69.140.16/29-4.69.140.16-4.69.140.23]", + "eval.tests.test_conversion_formats.test_range_start_last_columns[5.61.192.0/21-5.61.192.0-5.61.199.255]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-cidr--include-hex-range-header_prefix2]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-cidr--include-integer-range-header_prefix1]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-cidr--include-range-header_prefix0]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-integer-range--include-hex-range-header_prefix5]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-range--include-hex-range-header_prefix4]", + "eval.tests.test_conversion_formats.test_two_format_combinations[-include-range--include-integer-range-header_prefix3]" + ] + } + }, + "commit": "ee705d4db504039d7ab598bac9e77987ed1e2e83", + "data_source": "synthetic_programgym", + "difficulty": "easy", + "difficulty_score": 1.279210512601395, + "eval_clean_hashes": [ + "366a4c3584127927eb3b1bc6065b8ef73c4a4e5a83a9cb568a6c32c2e947b08f" + ], + "input_record": { + "commit": "ee705d4db504039d7ab598bac9e77987ed1e2e83", + "commits": 410, + "contributors": 17, + "difficulty": "easy", + "difficulty_code_lines": 317, + "difficulty_has_tests": false, + "difficulty_product_code_lines": 317, + "difficulty_runtime_deps": 5, + "difficulty_score": 1.279210512601395, + "difficulty_test_code_lines": 321, + "full_name": "maxmind/geoip2-csv-converter", + "github_stars": 218, + "input_joern_zip": "go_joern/maxmind__geoip2-csv-converter.zip", + "joern_status": true, + "joern_time": 11.362105883192271, + "language": "go", + "pb_match": [ + { + "pb_fullname": "sclevine/yj", + "rank": 93, + "similarity": 0.5406915545463562 + }, + { + "pb_fullname": "mikefarah/yq", + "rank": 232, + "similarity": 0.5561466217041016 + }, + { + "pb_fullname": "johnkerl/miller", + "rank": 30, + "similarity": 0.5665773153305054 + }, + { + "pb_fullname": "guumaster/hostctl", + "rank": 843, + "similarity": 0.44986647367477417 + }, + { + "pb_fullname": "multiprocessio/dsq", + "rank": 183, + "similarity": 0.5326363444328308 + }, + { + "pb_fullname": "noborus/trdsql", + "rank": 87, + "similarity": 0.5831088423728943 + }, + { + "pb_fullname": "antonmedv/fx", + "rank": 812, + "similarity": 0.4745869040489197 + }, + { + "pb_fullname": "tomnomnom/gron", + "rank": 285, + "similarity": 0.5111034512519836 + } + ], + "repo_age": 11.65, + "repo_path": "go/maxmind__geoip2-csv-converter", + "source": "commit:ee705d4db504039d7ab598bac9e77987ed1e2e83", + "status": "done", + "url": "https://github.com/maxmind/geoip2-csv-converter" + }, + "instance_id": "maxmind__geoip2-csv-converter.ee705d4", + "language": "go", + "module_iterations": [ + { + "actual_iterations": 2, + "branch_name": "generated_module_01", + "iteration_limit": 5, + "module_index": 1, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 2, + "branch_name": "generated_module_02", + "iteration_limit": 5, + "module_index": 2, + "module_kind": "source", + "termination_reason": "module_coverage_threshold_reached" + }, + { + "actual_iterations": 1, + "branch_name": "generated_module_03", + "iteration_limit": 5, + "module_index": 3, + "module_kind": "source", + "termination_reason": "coverage_path_attribution_failure" + } + ], + "repository": "maxmind/geoip2-csv-converter" +} diff --git a/maxmind--geoip2-csv-converter.ee/tests/test.sh b/maxmind--geoip2-csv-converter.ee/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..93c97cf1219034b84854bf1102d30b4347149dbe --- /dev/null +++ b/maxmind--geoip2-csv-converter.ee/tests/test.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Verifier exec may not inherit image ENV (Modal/gVisor, login-shell resets). +export PATH="/usr/local/go/bin:/go/bin:/usr/local/cargo/bin:/root/.cargo/bin:${PATH}" + +mkdir -p /logs/verifier /logs/artifacts + +write_failure() { + local code="$1" + local details="$2" + python3 - "$code" "$details" <<'PY' +import json +import sys +from pathlib import Path + +code, details = sys.argv[1:3] +try: + metadata = json.loads(Path("/tests/programgym_task.json").read_text()) + n_tests = sum( + len([ + name for name in info.get("tests", []) + if name not in {item.get("name") for item in info.get("ignored_tests", [])} + ]) + for branch, info in metadata.get("branches", {}).items() + if not info.get("ignored") + ) +except Exception: + n_tests = 0 +result = { + "test_results": [], + "error_code": code, + "error_details": details, + "log": [], + "solution_branch": "submission", + "test_branches": [], + "test_branch_errors": { + "__infra__": [{"error_code": code, "error_details": details}] + }, + "executable_hash": None, + "warnings": [], +} +diagnostics = { + "pass_rate": 0.0, + "resolved": 0, + "n_passed": 0, + "n_tests": n_tests, + "n_branch_errors": 1, + "infra_error": 1, + "executable_hash_present": 0, +} +Path("/logs/verifier/programgym_eval.json").write_text( + json.dumps(result, indent=2, sort_keys=True) +) +Path("/logs/verifier/harbor_diagnostics.json").write_text( + json.dumps(diagnostics, indent=2, sort_keys=True) +) +Path("/logs/verifier/reward.json").write_text( + json.dumps( + {"reward": 0.0, "resolved": 0.0, "almost_resolved": 0.0}, + indent=2, + sort_keys=True, + ) +) +Path("/logs/verifier/reward.txt").write_text("0.0") +Path("/logs/verifier/programgym_eval.log").write_text(details) +PY +} + +if ! command -v python3 >/dev/null 2>&1; then + write_failure "missing_python3" "python3 is required in the cleanroom image" + exit 0 +fi + +if ! python3 /tests/programgym_evaluator.py; then + if [ ! -s /logs/verifier/reward.txt ]; then + write_failure "evaluator_crashed" \ + "programgym_evaluator.py exited non-zero with no reward written" + fi +fi + +exit 0